I'm looking to launch several tests in parallel using multiprocessing:
testlist=[test1, test2, test3]
pool = ThreadPool(len(testlist))
try:
pool.map(run_test, testlist)
print('Success')
sys.exit(0)
except Exception:
print('FAILURE!')
sys.exit(1)
Is there a way to get all the threads to terminate if one of them throws an exception? It makes no sense to run all the tests if one fails early.