* Tests have been fixed with testtools 1.2.0 and above.
(Robert Collins)
+IMPROVEMENTS
+~~~~~~~~~~~~
+
+* With testtools 1.4.0 and above import errors are now
+ shown in detail by ``subunit.run``. (Robert Collins)
+
0.0.21
------
result.stopTestRun()
return result
- def list(self, test):
+ def list(self, test, loader=None):
"List the test."
result, errors = self._list(test)
+ if loader is not None:
+ # We were called with the updated API by testtools.run, so look for
+ # errors on the loader, not the test list result.
+ errors = loader.errors
if errors:
failed_descr = '\n'.join(errors).encode('utf8')
result.status(file_name="import errors", runnable=False,
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