Make Node.warn support two forms, new and deprecated

As suggested during review, it now accepts two forms:

Node.warn(warning_instance)  (recommended)

Node.warn(code, message)  (deprecated)
This commit is contained in:
Bruno Oliveira
2018-09-04 15:07:52 -03:00
parent 5ef51262f7
commit 47bf58d69e
10 changed files with 62 additions and 22 deletions

View File

@@ -126,7 +126,7 @@ class LsofFdLeakChecker(object):
error.append(error[0])
error.append("*** function %s:%s: %s " % item.location)
error.append("See issue #2366")
item.std_warn(pytest.PytestWarning("\n".join(error)))
item.warn(pytest.PytestWarning("\n".join(error)))
# XXX copied from execnet's conftest.py - needs to be merged