1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/49db048a7f4f/ Changeset: 49db048a7f4f User: hpk42 Date: 2014-07-03 12:58:12 Summary: avoid importing "py.test" (an old alias module for "pytest") Affected #: 3 files
diff -r 011b6de727bce776d2bb939e65a485c089351a71 -r 49db048a7f4f83fe07b74000b02c3d60043cfcd2 CHANGELOG --- a/CHANGELOG +++ b/CHANGELOG @@ -98,6 +98,7 @@ - fix issue512: show "<notset>" for arguments which might not be set in monkeypatch plugin. Improves output in documentation. +- avoid importing "py.test" (an old alias module for "pytest") 2.5.2 ----------------------------------- diff -r 011b6de727bce776d2bb939e65a485c089351a71 -r 49db048a7f4f83fe07b74000b02c3d60043cfcd2 _pytest/config.py --- a/_pytest/config.py +++ b/_pytest/config.py @@ -823,7 +823,8 @@ if default is not notset: return default if skip: - py.test.skip("no %r option found" %(name,)) + import pytest + pytest.skip("no %r option found" %(name,)) raise ValueError("no option named %r" % (name,)) def getvalue(self, name, path=None): diff -r 011b6de727bce776d2bb939e65a485c089351a71 -r 49db048a7f4f83fe07b74000b02c3d60043cfcd2 _pytest/core.py --- a/_pytest/core.py +++ b/_pytest/core.py @@ -137,7 +137,8 @@ def skipifmissing(self, name): if not self.hasplugin(name): - py.test.skip("plugin %r is missing" % name) + import pytest + pytest.skip("plugin %r is missing" % name) def hasplugin(self, name): return bool(self.getplugin(name)) @@ -220,10 +221,9 @@ return self.import_plugin(modname[7:]) raise except: + import pytest e = py.std.sys.exc_info()[1] - if not hasattr(py.test, 'skip'): - raise - elif not isinstance(e, py.test.skip.Exception): + if not hasattr(pytest, 'skip') or not isinstance(e, pytest.skip.Exception): raise self._warnings.append("skipped plugin %r: %s" %((modname, e.msg))) else: Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit