diff --git a/green/process.py b/green/process.py index b79a619..8859c43 100644 --- a/green/process.py +++ b/green/process.py @@ -234,7 +234,6 @@ def stop_callback(test_result): # Let the main process know what happened with the test run queue.put(test_result) - # Create a structure to return the results of this one test result = ProtoTestResult(start_callback, stop_callback) test = None try: diff --git a/green/result.py b/green/result.py index 71deec1..cfb9bd5 100644 --- a/green/result.py +++ b/green/result.py @@ -88,7 +88,7 @@ def getDescription(self, verbose): class ProtoError(): """I take a full-fledged test error and preserve just the information we - need and can bass between processes. + need and can pass between processes. """ def __init__(self, err=None): self.traceback_lines = traceback.format_exception(*err) @@ -207,6 +207,7 @@ def startTest(self, test): "Called before each test runs" # I can't quite figure out the exact reason tests get double-started in # test_uncaughtException, but this fixes it + test = proto_test(test) if test == self.current_test: # Don't double-start a test return diff --git a/green/runner.py b/green/runner.py index 37a87a9..626ee2b 100644 --- a/green/runner.py +++ b/green/runner.py @@ -92,7 +92,8 @@ def run(suite, stream, args): pool = LoggingDaemonlessPool(processes=args.processes or None, initializer=InitializerOrFinalizer(args.initializer), finalizer=InitializerOrFinalizer(args.finalizer)) - tests = [_AsyncChunk(t, multiprocessing.Manager().Queue()) for t in toParallelTestTargets(suite, args.targets)] + manager = multiprocessing.Manager() + tests = [_AsyncChunk(t, manager.Queue()) for t in toParallelTestTargets(suite, args.targets)] if tests: for index, test_chunk in enumerate(tests): if args.run_coverage: @@ -127,7 +128,7 @@ def run(suite, stream, args): if abort_tests: break - pool.terminate() + pool.close() pool.join() result.stopTestRun()