Show More
@@ -259,13 +259,6 b' def parseargs(args, parser):' | |||||
259 |
|
259 | |||
260 | if options.jobs < 1: |
|
260 | if options.jobs < 1: | |
261 | parser.error('--jobs must be positive') |
|
261 | parser.error('--jobs must be positive') | |
262 | if options.unittest: |
|
|||
263 | if options.jobs > 1: |
|
|||
264 | sys.stderr.write( |
|
|||
265 | 'warning: --jobs has no effect with --unittest') |
|
|||
266 | if options.loop: |
|
|||
267 | sys.stderr.write( |
|
|||
268 | 'warning: --loop has no effect with --unittest') |
|
|||
269 | if options.interactive and options.debug: |
|
262 | if options.interactive and options.debug: | |
270 | parser.error("-i/--interactive and -d/--debug are incompatible") |
|
263 | parser.error("-i/--interactive and -d/--debug are incompatible") | |
271 | if options.debug: |
|
264 | if options.debug: | |
@@ -1033,6 +1026,19 b' class TestResult(unittest._TextTestResul' | |||||
1033 | self.stream.write('~') |
|
1026 | self.stream.write('~') | |
1034 | self.stream.flush() |
|
1027 | self.stream.flush() | |
1035 |
|
1028 | |||
|
1029 | class TestSuite(unittest.TestSuite): | |||
|
1030 | """Custom unitest TestSuite that knows how to execute concurrently.""" | |||
|
1031 | ||||
|
1032 | def __init__(self, runner, *args, **kwargs): | |||
|
1033 | super(TestSuite, self).__init__(*args, **kwargs) | |||
|
1034 | ||||
|
1035 | self._runner = runner | |||
|
1036 | ||||
|
1037 | def run(self, result): | |||
|
1038 | self._runner._executetests(self._tests, result=result) | |||
|
1039 | ||||
|
1040 | return result | |||
|
1041 | ||||
1036 | class TextTestRunner(unittest.TextTestRunner): |
|
1042 | class TextTestRunner(unittest.TextTestRunner): | |
1037 | """Custom unittest test runner that uses appropriate settings.""" |
|
1043 | """Custom unittest test runner that uses appropriate settings.""" | |
1038 |
|
1044 | |||
@@ -1245,7 +1251,7 b' class TestRunner(object):' | |||||
1245 | for i, t in enumerate(tests)] |
|
1251 | for i, t in enumerate(tests)] | |
1246 |
|
1252 | |||
1247 | if self.options.unittest: |
|
1253 | if self.options.unittest: | |
1248 |
suite = |
|
1254 | suite = TestSuite(self, tests=tests) | |
1249 | verbosity = 1 |
|
1255 | verbosity = 1 | |
1250 | if self.options.verbose: |
|
1256 | if self.options.verbose: | |
1251 | verbosity = 2 |
|
1257 | verbosity = 2 |
General Comments 0
You need to be logged in to leave comments.
Login now