File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515import tempfile
1616from pathlib import Path
1717import shutil
18+ import traceback
1819
1920def check_docker ():
2021 docker_ps = smoketests .run_cmd ("docker" , "ps" , "--format=json" )
@@ -116,11 +117,22 @@ def main():
116117
117118 tests = loader .loadTestsFromNames (testlist )
118119 if args .list :
119- print ("Selected tests:\n " )
120+ failed_cls = getattr (unittest .loader , "_FailedTest" , None )
121+ any_failed = False
120122 for test in _iter_all_tests (tests ):
121123 name = test .id ()
122- print (f"{ name } " )
123- exit (0 )
124+ if isinstance (test , failed_cls ):
125+ any_failed = True
126+ print ('' )
127+ print ("Failed to construct %s:" % test .id ())
128+ exc = getattr (test , "_exception" , None )
129+ if exc is not None :
130+ tb = '' .join (traceback .format_exception (exc ))
131+ print (tb .rstrip ())
132+ print ('' )
133+ else :
134+ print (f"{ name } " )
135+ exit (1 if any_failed else 0 )
124136
125137 if not args .no_build_cli :
126138 logging .info ("Compiling spacetime cli..." )
You can’t perform that action at this time.
0 commit comments