diff options
author | holger krekel <holger@merlinux.eu> | 2010-11-13 21:03:28 +0100 |
---|---|---|
committer | holger krekel <holger@merlinux.eu> | 2010-11-13 21:03:28 +0100 |
commit | 82ba645a2ec1c64a588c58d1b12239136ee4b99f (patch) | |
tree | 1aefe3c17da2f77b3adff5c83db473b57d3ab177 /testing/test_runner.py | |
parent | 1bc444d5c8177cb7e1f2f8c14d8cd232aac54201 (diff) | |
download | pytest-82ba645a2ec1c64a588c58d1b12239136ee4b99f.tar.gz |
fix skip reporting over distributed testing. if we have a "skip" report
rep.longrepr will now be a 3-tuple (path, lineno, message)
Diffstat (limited to 'testing/test_runner.py')
-rw-r--r-- | testing/test_runner.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/testing/test_runner.py b/testing/test_runner.py index 6198e4fdf..9dfaba02c 100644 --- a/testing/test_runner.py +++ b/testing/test_runner.py @@ -344,13 +344,18 @@ def test_exception_printing_skip(): def test_importorskip(): importorskip = py.test.importorskip + def f(): + importorskip("asdlkj") try: sys = importorskip("sys") assert sys == py.std.sys #path = py.test.importorskip("os.path") #assert path == py.std.os.path - py.test.raises(py.test.skip.Exception, - "py.test.importorskip('alskdj')") + excinfo = py.test.raises(py.test.skip.Exception, f) + path = py.path.local(excinfo.getrepr().reprcrash.path) + # check that importorskip reports the actual call + # in this test the test_runner.py file + assert path.purebasename == "test_runner" py.test.raises(SyntaxError, "py.test.importorskip('x y z')") py.test.raises(SyntaxError, "py.test.importorskip('x=y')") path = importorskip("py", minversion=".".join(py.__version__)) |