fixed circular imports by reverting a few py.test -> pytest substitions.

This commit is contained in:
holger krekel 2014-01-22 11:17:25 +01:00
parent 836232e544
commit 1ffc006363
3 changed files with 10 additions and 8 deletions

View File

@ -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
-----------------------------------

View File

@ -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:

View File

@ -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: