Commit 2c4fd432 authored by Cédric Krier's avatar Cédric Krier

Raise DistutilsError and log result

parent 9f37eb81
...@@ -3,7 +3,8 @@ import operator ...@@ -3,7 +3,8 @@ import operator
import sys import sys
import contextlib import contextlib
import itertools import itertools
from distutils.errors import DistutilsOptionError from distutils.errors import DistutilsError, DistutilsOptionError
from distutils import log
from unittest import TestLoader from unittest import TestLoader
from setuptools.extern import six from setuptools.extern import six
...@@ -233,7 +234,9 @@ class test(Command): ...@@ -233,7 +234,9 @@ class test(Command):
**exit_kwarg **exit_kwarg
) )
if not test.result.wasSuccessful(): if not test.result.wasSuccessful():
sys.exit(1) msg = 'Test failed: %s' % test.result
self.announce(msg, log.ERROR)
raise DistutilsError(msg)
@property @property
def _argv(self): def _argv(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment