[py-svn] pytest-xdist commit 2bda8b5eecd3: adapt to new import locations

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Nov 13 11:12:31 CET 2010


# HG changeset patch -- Bitbucket.org
# Project pytest-xdist
# URL http://bitbucket.org/hpk42/pytest-xdist/overview
# User holger krekel <holger at merlinux.eu>
# Date 1289643139 -3600
# Node ID 2bda8b5eecd3cc2b9f4eb991826a88f3821ab17b
# Parent  8cea75c227061419aa3044cad31e756596716bec
adapt to new import locations

--- a/ISSUES.txt
+++ b/ISSUES.txt
@@ -2,12 +2,11 @@ rename / hooks
 -----------------------------------------------
 tag: bug
 
-node -> slave 
+node -> slave
 transition for hooks?
 configure_node -> configure_slave
 
-
-allow to run xdist tests with xdist
+allow to remotely run xdist tests with xdist
 -----------------------------------------------
 tag: feature
 
@@ -16,3 +15,10 @@ currently this doesn't work because the 
 has no py.test plugin.   How to configure/do
 register "xdist.plugin" on the remote side?
 
+see to avoid any "from _pytest" internal imports
+-----------------------------------------------
+tag: feature
+
+currently tests and even xdist core code imports
+names from the internal _pytest namespace.
+See to avoid it.

--- a/xdist/plugin.py
+++ b/xdist/plugin.py
@@ -236,7 +236,7 @@ def pytest_runtest_protocol(item):
 def forked_run_report(item):
     # for now, we run setup/teardown in the subprocess
     # XXX optionally allow sharing of setup/teardown
-    from pytest.plugin.runner import runtestprotocol
+    from _pytest.runner import runtestprotocol
     EXITSTATUS_TESTEXIT = 4
     import marshal
     from xdist.remote import serialize_report
@@ -262,7 +262,7 @@ def report_process_crash(item, result):
     path, lineno = item._getfslineno()
     info = "%s:%s: running the test CRASHED with signal %d" %(
             path, lineno, result.signal)
-    from pytest.plugin import runner
+    from _pytest import runner
     call = runner.CallInfo(lambda: 0/0, "???")
     call.excinfo = info
     rep = runner.pytest_runtest_makereport(item, call)

--- a/xdist/__init__.py
+++ b/xdist/__init__.py
@@ -1,2 +1,2 @@
 #
-__version__ = '1.5a6'
+__version__ = '1.5a7'

--- a/testing/test_slavemanage.py
+++ b/testing/test_slavemanage.py
@@ -11,8 +11,8 @@ def pytest_funcarg__hookrecorder(request
 
 def pytest_funcarg__hook(request):
     from xdist import newhooks
-    from pytest.main import HookRelay, PluginManager
-    from pytest import hookspec
+    from _pytest.core import HookRelay, PluginManager
+    from _pytest import hookspec
     return HookRelay([hookspec, newhooks], PluginManager())
 
 class pytest_funcarg__mysetup:

--- a/xdist/slavemanage.py
+++ b/xdist/slavemanage.py
@@ -3,7 +3,7 @@ import sys, os
 import execnet
 import xdist.remote
 
-from pytest.plugin import runner # XXX load dynamically
+from _pytest import runner # XXX load dynamically
 
 class NodeManager(object):
     def __init__(self, config, specs=None):

--- a/xdist/looponfail.py
+++ b/xdist/looponfail.py
@@ -119,7 +119,7 @@ def init_slave_session(channel, args, op
     sys.path[:] = newpaths
 
     #fullwidth, hasmarkup = channel.receive()
-    from pytest.plugin.config import Config
+    from _pytest.config import Config
     config = Config()
     config.option.__dict__.update(option_dict)
     config._preparse(args)

--- a/xdist/remote.py
+++ b/xdist/remote.py
@@ -105,7 +105,7 @@ def getinfodict():
     )
 
 def remote_initconfig(option_dict, args):
-    from pytest.plugin.config import Config
+    from _pytest.config import Config
     config = Config()
     config.pluginmanager.unregister(name="terminal")
     config._preparse(args, addopts=False)

--- a/testing/test_dsession.py
+++ b/testing/test_dsession.py
@@ -1,5 +1,5 @@
 from xdist.dsession import DSession, LoadScheduling, EachScheduling
-from pytest.plugin import session as outcome
+from _pytest import session as outcome
 import py
 import execnet
 
@@ -140,7 +140,7 @@ class TestDistReporter:
     @py.test.mark.xfail
     def test_rsync_printing(self, testdir, linecomp):
         config = testdir.parseconfig()
-        from pytest.plugin.pytest_terminal import TerminalReporter
+        from _pytest.pytest_terminal import TerminalReporter
         rep = TerminalReporter(config, file=linecomp.stringio)
         config.pluginmanager.register(rep, "terminalreporter")
         dsession = DSession(config)

--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ from setuptools import setup
 
 setup(
     name="pytest-xdist",
-    version='1.5a6',
+    version='1.5a7',
     description='py.test xdist plugin for distributed testing and loop-on-failing modes',
     long_description=__doc__,
     license='GPLv2 or later',



More information about the pytest-commit mailing list