summaryrefslogtreecommitdiff
path: root/python/subunit/tests/test_run.py
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2014-11-18 21:57:57 +1300
committerRobert Collins <robertc@robertcollins.net>2014-11-18 21:57:57 +1300
commita129fa2ff6d0f623f9b99f036a6d9b4174d972ce (patch)
tree0830c5dd026ff896c02a0b5f71bdd1505176e81e /python/subunit/tests/test_run.py
parent7c203ff76e7ab83d954cfd6ea1cb4d75f9881823 (diff)
downloadsubunit-git-a129fa2ff6d0f623f9b99f036a6d9b4174d972ce.tar.gz
Improve showing of import errors in the Python runner.
This depends on testtools 1.4.0 to get the improved behaviour.
Diffstat (limited to 'python/subunit/tests/test_run.py')
-rw-r--r--python/subunit/tests/test_run.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/python/subunit/tests/test_run.py b/python/subunit/tests/test_run.py
index de9b094..3339a82 100644
--- a/python/subunit/tests/test_run.py
+++ b/python/subunit/tests/test_run.py
@@ -65,6 +65,18 @@ class TestSubunitTestRunner(TestCase):
exc = self.assertRaises(SystemExit, runner.list, None)
self.assertEqual((2,), exc.args)
+ def test_list_includes_loader_errors(self):
+ bytestream = io.BytesIO()
+ runner = SubunitTestRunner(stream=bytestream)
+ def list_test(test):
+ return [], []
+ class Loader(object):
+ errors = ['failed import']
+ loader = Loader()
+ self.patch(run, 'list_test', list_test)
+ exc = self.assertRaises(SystemExit, runner.list, None, loader=loader)
+ self.assertEqual((2,), exc.args)
+
class FailingTest(TestCase):
def test_fail(self):
1/0