Skip to content

Commit

Permalink
adapt to new import locations
Browse files Browse the repository at this point in the history
  • Loading branch information
hpk42 committed Nov 13, 2010
1 parent 8272a66 commit a0652e9
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 14 deletions.
12 changes: 9 additions & 3 deletions ISSUES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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',
Expand Down
4 changes: 2 additions & 2 deletions testing/test_dsession.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions testing/test_slavemanage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion xdist/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#
__version__ = '1.5a6'
__version__ = '1.5a7'
2 changes: 1 addition & 1 deletion xdist/looponfail.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions xdist/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion xdist/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion xdist/slavemanage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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):
Expand Down

0 comments on commit a0652e9

Please sign in to comment.