diff --git a/py/__init__.py b/py/__init__.py index 7c49ef5c5..b7a8a5f3b 100644 --- a/py/__init__.py +++ b/py/__init__.py @@ -9,7 +9,7 @@ dictionary or an import path. (c) Holger Krekel and others, 2009 """ -version = "1.1.2" +version = "1.1.1post1" __version__ = version = version or "1.1.x" import py.apipkg diff --git a/py/impl/test/dist/dsession.py b/py/impl/test/dist/dsession.py index 09ce92669..e435d7f90 100644 --- a/py/impl/test/dist/dsession.py +++ b/py/impl/test/dist/dsession.py @@ -215,15 +215,16 @@ class DSession(Session): for node, pending in self.node2pending.items(): room = min(self.MAXITEMSPERHOST - len(pending), room) sending = tosend[:room] - for node, pending in self.node2pending.items(): - node.sendlist(sending) - pending.extend(sending) - for item in sending: - nodes = self.item2nodes.setdefault(item, []) - assert node not in nodes - nodes.append(node) - self.config.hook.pytest_itemstart(item=item, node=node) - tosend[:] = tosend[room:] # update inplace + if sending: + for node, pending in self.node2pending.items(): + node.sendlist(sending) + pending.extend(sending) + for item in sending: + nodes = self.item2nodes.setdefault(item, []) + assert node not in nodes + nodes.append(node) + self.config.hook.pytest_itemstart(item=item, node=node) + tosend[:] = tosend[room:] # update inplace if tosend: # we have some left, give it to the main loop self.queueevent("pytest_rescheduleitems", items=tosend) diff --git a/py/impl/test/dist/txnode.py b/py/impl/test/dist/txnode.py index 7c19b08b1..429f8dc5c 100644 --- a/py/impl/test/dist/txnode.py +++ b/py/impl/test/dist/txnode.py @@ -42,7 +42,7 @@ class TXNode(object): if eventcall == self.ENDMARK: err = self.channel._getremoteerror() if not self._down: - if not err: + if not err or isinstance(err, EOFError): err = "Not properly terminated" self.notify("pytest_testnodedown", node=self, error=err) self._down = True diff --git a/py/plugin/pytest_pdb.py b/py/plugin/pytest_pdb.py index 058016751..2cd2301a9 100644 --- a/py/plugin/pytest_pdb.py +++ b/py/plugin/pytest_pdb.py @@ -16,9 +16,10 @@ def pytest_addoption(parser): help="start pdb (the Python debugger) on errors.") -def pytest_configure(config): +def pytest_configure(__multicall__, config): if config.option.usepdb: if execnet: + __multicall__.execute() if config.getvalue("looponfail"): raise config.Error("--pdb incompatible with --looponfail.") if config.option.dist != "no": diff --git a/setup.py b/setup.py index a756b208c..e8a6092f5 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ def main(): name='py', description='py.test and pylib: rapid testing and development utils.', long_description = long_description, - version= trunk or '1.1.2', + version= trunk or '1.1.1post1', url='http://pylib.org', license='MIT license', platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'], diff --git a/testing/plugin/test_pytest_pdb.py b/testing/plugin/test_pytest_pdb.py index 4dd57f015..10de3742d 100644 --- a/testing/plugin/test_pytest_pdb.py +++ b/testing/plugin/test_pytest_pdb.py @@ -36,8 +36,8 @@ class TestPDB: assert i == 1 """) child = testdir.spawn_pytest("--pdb %s" % p1) - #child.expect(".*def test_1.*") - child.expect(".*i = 0.*") + child.expect(".*def test_1") + child.expect(".*i = 0") child.expect("(Pdb)") child.sendeof() child.expect("1 failed") @@ -50,7 +50,7 @@ class TestPDB: py.test.raises(Error, "testdir.parseconfigure('--pdb', '--looponfail')") result = testdir.runpytest("--pdb", "-n", "3") assert result.ret != 0 - assert "incompatible" in result.stdout.str() + assert "incompatible" in result.stderr.str() result = testdir.runpytest("--pdb", "-d", "--tx", "popen") assert result.ret != 0 - assert "incompatible" in result.stdout.str() + assert "incompatible" in result.stderr.str() diff --git a/testing/pytest/dist/acceptance_test.py b/testing/pytest/dist/acceptance_test.py index e26823ebd..c845d2e98 100644 --- a/testing/pytest/dist/acceptance_test.py +++ b/testing/pytest/dist/acceptance_test.py @@ -49,8 +49,8 @@ class TestDistribution: ) result = testdir.runpytest(p1, '-d', '--tx=popen', '--tx=popen') result.stdout.fnmatch_lines([ + "*0*popen*Python*", "*1*popen*Python*", - "*2*popen*Python*", "*2 failed, 1 passed, 1 skipped*", ]) assert result.ret == 1 @@ -73,9 +73,9 @@ class TestDistribution: """) result = testdir.runpytest(p1, '-d') result.stdout.fnmatch_lines([ + "*0*popen*Python*", "*1*popen*Python*", "*2*popen*Python*", - "*3*popen*Python*", "*2 failed, 1 passed, 1 skipped*", ]) assert result.ret == 1 @@ -122,7 +122,7 @@ class TestDistribution: "--tx=popen//chdir=%(dest)s" % locals(), p) assert result.ret == 0 result.stdout.fnmatch_lines([ - "*1* *popen*platform*", + "*0* *popen*platform*", #"RSyncStart: [G1]", #"RSyncFinished: [G1]", "*1 passed*" diff --git a/testing/pytest/dist/test_gwmanage.py b/testing/pytest/dist/test_gwmanage.py index 2fc80f959..40bfef036 100644 --- a/testing/pytest/dist/test_gwmanage.py +++ b/testing/pytest/dist/test_gwmanage.py @@ -37,10 +37,10 @@ class TestGatewayManagerPopen: hm.makegateways() call = hookrecorder.popcall("pytest_gwmanage_newgateway") assert call.gateway.spec == execnet.XSpec("popen") - assert call.gateway.id == "1" + assert call.gateway.id == "gw0" assert call.platinfo.executable == call.gateway._rinfo().executable call = hookrecorder.popcall("pytest_gwmanage_newgateway") - assert call.gateway.id == "2" + assert call.gateway.id == "gw1" assert len(hm.group) == 2 hm.exit() assert not len(hm.group) @@ -66,7 +66,7 @@ class TestGatewayManagerPopen: l = [] hm.rsync(source, notify=lambda *args: l.append(args)) assert len(l) == 1 - assert l[0] == ("rsyncrootready", hm.group['1'].spec, source) + assert l[0] == ("rsyncrootready", hm.group['gw0'].spec, source) hm.exit() dest = dest.join(source.basename) assert dest.join("dir1").check() diff --git a/testing/pytest/dist/test_txnode.py b/testing/pytest/dist/test_txnode.py index 62c8423ad..a32c62ab6 100644 --- a/testing/pytest/dist/test_txnode.py +++ b/testing/pytest/dist/test_txnode.py @@ -79,7 +79,7 @@ class TestMasterSlaveConnection: node.send(123) # invalid item kwargs = mysetup.geteventargs("pytest_testnodedown") assert kwargs['node'] is node - assert str(kwargs['error']).find("AttributeError") != -1 + assert "Not properly terminated" in str(kwargs['error']) def test_crash_killed(self, testdir, mysetup): if not hasattr(py.std.os, 'kill'): @@ -87,13 +87,13 @@ class TestMasterSlaveConnection: item = testdir.getitem(""" def test_func(): import os - os.kill(os.getpid(), 15) + os.kill(os.getpid(), 9) """) node = mysetup.makenode(item.config) node.send(item) kwargs = mysetup.geteventargs("pytest_testnodedown") assert kwargs['node'] is node - assert str(kwargs['error']).find("Not properly terminated") != -1 + assert "Not properly terminated" in str(kwargs['error']) def test_node_down(self, mysetup): node = mysetup.makenode()