@@ -47,11 +47,7 @@ def _partial2(wrapped, *partialArgs, **partialKwargs):
4747 def wrapper (* args , ** kwargs ):
4848 args = args + partialArgs [len (args ):]
4949 kwargs .update (partialKwargs )
50- try :
51- wrapped (* args , ** kwargs )
52- except SystemExit :
53- # Each run of the functional tests will exit at the end.
54- pass
50+ wrapped (* args , ** kwargs )
5551 return update_wrapper (wrapper , wrapped )
5652
5753
@@ -181,7 +177,11 @@ def _runTest(testCase, testFilePath):
181177
182178 _enablePEP8Checker (runner .linter )
183179
184- runner .run ([moduleName ])
180+ exitCode = None
181+ try :
182+ runner .run ([moduleName ])
183+ except SystemExit as error :
184+ exitCode = error .code
185185
186186 # Check the results
187187 expectedResult = open (pathResultFile ).read ().strip ()
@@ -192,6 +192,11 @@ def _runTest(testCase, testFilePath):
192192 except unittest .FailTest :
193193 testCase .fail (_formatResults (moduleName , expectedResult , outputResult ))
194194
195+ if not expectedResult :
196+ testCase .assertEqual (0 , exitCode )
197+ else :
198+ testCase .assertNotEqual (0 , exitCode )
199+
195200
196201
197202def _testNameFromModuleName (moduleName ):
0 commit comments