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