summaryrefslogtreecommitdiff
path: root/python/subunit/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/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/run.py')
-rwxr-xr-xpython/subunit/run.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python/subunit/run.py b/python/subunit/run.py
index cf9cc01..5bf1db2 100755
--- a/python/subunit/run.py
+++ b/python/subunit/run.py
@@ -70,9 +70,13 @@ class SubunitTestRunner(object):
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,