adapt xdist plugin - it still uses some internal imports
This commit is contained in:
2
setup.py
2
setup.py
@@ -22,7 +22,7 @@ setup(
|
|||||||
packages = ['xdist'],
|
packages = ['xdist'],
|
||||||
entry_points = {'pytest11': ['xdist = xdist.plugin'],},
|
entry_points = {'pytest11': ['xdist = xdist.plugin'],},
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
install_requires = ['execnet>=1.0.7', 'py>1.3.9'],
|
install_requires = ['execnet>=1.0.7', 'pylib>1.3.9'],
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Development Status :: 5 - Production/Stable',
|
'Development Status :: 5 - Production/Stable',
|
||||||
'Intended Audience :: Developers',
|
'Intended Audience :: Developers',
|
||||||
|
|||||||
@@ -236,6 +236,8 @@ class TestDistEach:
|
|||||||
assert not result.ret
|
assert not result.ret
|
||||||
result.stdout.fnmatch_lines(["*2 pass*"])
|
result.stdout.fnmatch_lines(["*2 pass*"])
|
||||||
|
|
||||||
|
@py.test.mark.xfail(run=False,
|
||||||
|
reason="other python versions might not have py.test installed")
|
||||||
def test_simple_diffoutput(self, testdir):
|
def test_simple_diffoutput(self, testdir):
|
||||||
interpreters = []
|
interpreters = []
|
||||||
for name in ("python2.5", "python2.6"):
|
for name in ("python2.5", "python2.6"):
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from xdist.dsession import DSession, LoadScheduling, EachScheduling
|
from xdist.dsession import DSession, LoadScheduling, EachScheduling
|
||||||
from py._test import session as outcome
|
from pytest.plugin import pytest_session as outcome
|
||||||
import py
|
import py
|
||||||
import execnet
|
import execnet
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ class TestDistReporter:
|
|||||||
@py.test.mark.xfail
|
@py.test.mark.xfail
|
||||||
def test_rsync_printing(self, testdir, linecomp):
|
def test_rsync_printing(self, testdir, linecomp):
|
||||||
config = testdir.parseconfig()
|
config = testdir.parseconfig()
|
||||||
from py._plugin.pytest_terminal import TerminalReporter
|
from pytest.plugin.pytest_terminal import TerminalReporter
|
||||||
rep = TerminalReporter(config, file=linecomp.stringio)
|
rep = TerminalReporter(config, file=linecomp.stringio)
|
||||||
config.pluginmanager.register(rep, "terminalreporter")
|
config.pluginmanager.register(rep, "terminalreporter")
|
||||||
dsession = DSession(config)
|
dsession = DSession(config)
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ def pytest_funcarg__hookrecorder(request):
|
|||||||
|
|
||||||
def pytest_funcarg__hook(request):
|
def pytest_funcarg__hook(request):
|
||||||
from xdist import newhooks
|
from xdist import newhooks
|
||||||
from py._test.pluginmanager import HookRelay, Registry
|
from pytest.pluginmanager import HookRelay, Registry
|
||||||
from py._plugin import hookspec
|
from pytest.plugin import hookspec
|
||||||
return HookRelay([hookspec, newhooks], Registry())
|
return HookRelay([hookspec, newhooks], Registry())
|
||||||
|
|
||||||
class pytest_funcarg__mysetup:
|
class pytest_funcarg__mysetup:
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
import py
|
import py
|
||||||
import sys
|
import sys
|
||||||
import execnet
|
import execnet
|
||||||
from py._test.session import gettopdir
|
|
||||||
|
|
||||||
def looponfail_main(config):
|
def looponfail_main(config):
|
||||||
remotecontrol = RemoteControl(config)
|
remotecontrol = RemoteControl(config)
|
||||||
# XXX better configure rootdir
|
# XXX better configure rootdir
|
||||||
|
gettopdir = config.pluginmanager.getplugin("session").gettopdir
|
||||||
rootdirs = [gettopdir(config.args)]
|
rootdirs = [gettopdir(config.args)]
|
||||||
statrecorder = StatRecorder(rootdirs)
|
statrecorder = StatRecorder(rootdirs)
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ def pytest_runtest_protocol(item):
|
|||||||
def forked_run_report(item):
|
def forked_run_report(item):
|
||||||
# for now, we run setup/teardown in the subprocess
|
# for now, we run setup/teardown in the subprocess
|
||||||
# XXX optionally allow sharing of setup/teardown
|
# XXX optionally allow sharing of setup/teardown
|
||||||
from py._plugin.pytest_runner import runtestprotocol
|
from pytest.plugin.pytest_runner import runtestprotocol
|
||||||
EXITSTATUS_TESTEXIT = 4
|
EXITSTATUS_TESTEXIT = 4
|
||||||
import marshal
|
import marshal
|
||||||
from xdist.remote import serialize_report
|
from xdist.remote import serialize_report
|
||||||
@@ -254,7 +254,7 @@ def report_process_crash(item, result):
|
|||||||
path, lineno = item._getfslineno()
|
path, lineno = item._getfslineno()
|
||||||
info = "%s:%s: running the test CRASHED with signal %d" %(
|
info = "%s:%s: running the test CRASHED with signal %d" %(
|
||||||
path, lineno, result.signal)
|
path, lineno, result.signal)
|
||||||
from py._plugin import pytest_runner as runner
|
from pytest.plugin import pytest_runner as runner
|
||||||
call = runner.CallInfo(lambda: 0/0, "???")
|
call = runner.CallInfo(lambda: 0/0, "???")
|
||||||
call.excinfo = info
|
call.excinfo = info
|
||||||
rep = runner.pytest_runtest_makereport(item, call)
|
rep = runner.pytest_runtest_makereport(item, call)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import sys, os
|
|||||||
import execnet
|
import execnet
|
||||||
import xdist.remote
|
import xdist.remote
|
||||||
|
|
||||||
from py._plugin import pytest_runner as runner # XXX load dynamically
|
from pytest.plugin import pytest_runner as runner # XXX load dynamically
|
||||||
|
|
||||||
class NodeManager(object):
|
class NodeManager(object):
|
||||||
def __init__(self, config, specs=None):
|
def __init__(self, config, specs=None):
|
||||||
|
|||||||
Reference in New Issue
Block a user