File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
mmengine/testing/_internal Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,8 @@ def __init__(self, method_name: str = 'runTest') -> None:
101101 if method_name != 'runTest' :
102102 # we allow instantiation with no explicit method name
103103 # but not an *incorrect* or missing method name
104- raise ValueError (f"no such test method in { self .__class__ } : { method_name } " ) from e
104+ raise ValueError (f'no such test method in { self .__class__ } :'
105+ f' { method_name } ' ) from e
105106
106107 def setUp (self ) -> None :
107108 super ().setUp ()
@@ -351,12 +352,13 @@ def _check_return_codes(self, elapsed_time) -> None:
351352 if first_process .exitcode == skip .exit_code :
352353 raise unittest .SkipTest (skip .message )
353354
354- # Skip the unittest since the raised error maybe not caused by
355- # the tested function. For example, in CI environment, the tested
356- # method could be terminated by system signal for the limited
357- # resources.
358- self .skipTest (f'Skip test { self ._testMethodName } due to '
359- 'the program abort' )
355+ if first_process .exitcode != 0 :
356+ # Skip the unittest since the raised error maybe not caused by
357+ # the tested function. For example, in CI environment, the tested
358+ # method could be terminated by system signal for the limited
359+ # resources.
360+ self .skipTest (f'Skip test { self ._testMethodName } due to '
361+ 'the program abort' )
360362
361363 @property
362364 def is_master (self ) -> bool :
You can’t perform that action at this time.
0 commit comments