adapt to new import locations

This commit is contained in:
holger krekel
2010-11-13 11:12:19 +01:00
parent 8272a669a4
commit a0652e9d99
9 changed files with 20 additions and 14 deletions

View File

@@ -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 remote side
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.

View File

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

View File

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

View File

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

View File

@@ -1,2 +1,2 @@
#
__version__ = '1.5a6'
__version__ = '1.5a7'

View File

@@ -119,7 +119,7 @@ def init_slave_session(channel, args, option_dict):
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)

View File

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

View File

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

View File

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