aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command
diff options
context:
space:
mode:
authorCédric Krier <ced@b2ck.com>2016-12-16 15:32:16 +0100
committerCédric Krier <ced@b2ck.com>2016-12-16 15:32:16 +0100
commit9f37eb817df5d9453e49edbcf2760832f333af68 (patch)
tree3381e7ed3b145983fca9905f849b529943e1829f /setuptools/command
parent083929cf87fe74e21a1a37afcb300ae73652b136 (diff)
downloadexternal_python_setuptools-9f37eb817df5d9453e49edbcf2760832f333af68.tar.gz
external_python_setuptools-9f37eb817df5d9453e49edbcf2760832f333af68.tar.bz2
external_python_setuptools-9f37eb817df5d9453e49edbcf2760832f333af68.zip
Exit on test failure
When test fails, it should not continue to run other commands. Fixes #891
Diffstat (limited to 'setuptools/command')
-rw-r--r--setuptools/command/test.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py
index 9a5117be..60ba2354 100644
--- a/setuptools/command/test.py
+++ b/setuptools/command/test.py
@@ -226,12 +226,14 @@ class test(Command):
list(map(sys.modules.__delitem__, del_modules))
exit_kwarg = {} if sys.version_info < (2, 7) else {"exit": False}
- unittest_main(
+ test = unittest_main(
None, None, self._argv,
testLoader=self._resolve_as_ep(self.test_loader),
testRunner=self._resolve_as_ep(self.test_runner),
**exit_kwarg
)
+ if not test.result.wasSuccessful():
+ sys.exit(1)
@property
def _argv(self):