From 1b48cbb3c6c073ff840367afab299398ff936e68 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 21 May 2009 14:33:15 +0200 Subject: [PATCH] * xspec: define str(xspec) to give back the original specification string * fix a test invocation --HG-- branch : trunk --- py/execnet/testing/test_xspec.py | 3 ++- py/execnet/xspec.py | 2 ++ py/test/dist/testing/test_nodemanage.py | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/py/execnet/testing/test_xspec.py b/py/execnet/testing/test_xspec.py index 9949a08b4..205cb1c6d 100644 --- a/py/execnet/testing/test_xspec.py +++ b/py/execnet/testing/test_xspec.py @@ -36,9 +36,10 @@ class TestXSpec: for x in ("popen", "popen//python=this"): assert XSpec(x)._spec == x - def test_repr(self): + def test_repr_and_string(self): for x in ("popen", "popen//python=this"): assert repr(XSpec(x)).find("popen") != -1 + assert str(XSpec(x)) == x def test_hash_equality(self): assert XSpec("popen") == XSpec("popen") diff --git a/py/execnet/xspec.py b/py/execnet/xspec.py index 871d160a0..732469b9b 100644 --- a/py/execnet/xspec.py +++ b/py/execnet/xspec.py @@ -27,6 +27,8 @@ class XSpec: def __repr__(self): return "" %(self._spec,) + def __str__(self): + return self._spec def __hash__(self): return hash(self._spec) diff --git a/py/test/dist/testing/test_nodemanage.py b/py/test/dist/testing/test_nodemanage.py index dd0a7284c..f8625bac8 100644 --- a/py/test/dist/testing/test_nodemanage.py +++ b/py/test/dist/testing/test_nodemanage.py @@ -121,7 +121,7 @@ class TestNodeManager: pass """) reprec = testdir.inline_run("-d", "--rsyncdir=%s" % testdir.tmpdir, - "--tx %s" % specssh, testdir.tmpdir) - ev = reprec.getfirstnamed("pytest_itemtestreport") - assert ev.passed + "--tx", specssh, testdir.tmpdir) + rep, = reprec.getreports("pytest_itemtestreport") + assert rep.passed