diff --git a/CHANGELOG b/CHANGELOG index e9164b61a..306e5435c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,12 +5,13 @@ UNRELEASED trying to import from collections.abc which causes problems for py27/cx_freeze. Thanks Wolfgang L. for reporting and tracking it down. -- fixed docs and code to use "pytest" instead of "py.test" everywhere. - Thanks Jurko Gospodnetic for the complete PR. +- fixed docs and code to use "pytest" instead of "py.test" almost everywhere. + Thanks Jurko Gospodnetic for the complete PR. - fix issue425: mention at end of "py.test -h" that --markers and --fixtures work according to specified test path (or current dir) + 2.5.1 ----------------------------------- diff --git a/_pytest/config.py b/_pytest/config.py index 0d068fe8a..bf2c090d8 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -1,7 +1,7 @@ """ command line options, ini-file and conftest.py processing. """ import py -import pytest +# DON't import pytest here because it causes import cycle troubles import sys, os from _pytest import hookspec # the extension point definitions from _pytest.core import PluginManager @@ -817,7 +817,8 @@ class Config(object): raise KeyError(name) return val except KeyError: - pytest.skip("no %r value found" %(name,)) + import pytest + py.test.skip("no %r value found" %(name,)) def exists(path, ignore=EnvironmentError): try: diff --git a/_pytest/core.py b/_pytest/core.py index 7d5e1c1ae..d029e7223 100644 --- a/_pytest/core.py +++ b/_pytest/core.py @@ -4,7 +4,7 @@ pytest PluginManager, basic initialization and tracing. import sys import inspect import py -import pytest +# don't import pytest to avoid circular imports assert py.__version__.split(".")[:2] >= ['1', '4'], ("installation problem: " "%s is too old, remove or upgrade 'py'" % (py.__version__)) @@ -137,7 +137,7 @@ class PluginManager(object): def skipifmissing(self, name): if not self.hasplugin(name): - pytest.skip("plugin %r is missing" % name) + py.test.skip("plugin %r is missing" % name) def hasplugin(self, name): return bool(self.getplugin(name)) @@ -221,9 +221,9 @@ class PluginManager(object): raise except: e = py.std.sys.exc_info()[1] - if not hasattr(pytest, 'skip'): + if not hasattr(py.test, 'skip'): raise - elif not isinstance(e, pytest.skip.Exception): + elif not isinstance(e, py.test.skip.Exception): raise self._hints.append("skipped plugin %r: %s" %((modname, e.msg))) else: