summaryrefslogtreecommitdiffstats
path: root/Lib/test/libregrtest/runtest_mp.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/libregrtest/runtest_mp.py')
-rw-r--r--Lib/test/libregrtest/runtest_mp.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py
index 1a82b3d..74424c1 100644
--- a/Lib/test/libregrtest/runtest_mp.py
+++ b/Lib/test/libregrtest/runtest_mp.py
@@ -3,6 +3,7 @@ import os
import sys
import time
import traceback
+import types
import unittest
from queue import Queue
from test import support
@@ -30,14 +31,8 @@ def run_test_in_subprocess(testname, ns):
"""
from subprocess import Popen, PIPE
- args = (testname, ns.verbose, ns.quiet)
- kwargs = dict(huntrleaks=ns.huntrleaks,
- use_resources=ns.use_resources,
- output_on_failure=ns.verbose3,
- timeout=ns.timeout,
- failfast=ns.failfast,
- match_tests=ns.match_tests)
- slaveargs = (args, kwargs)
+ ns_dict = vars(ns)
+ slaveargs = (ns_dict, testname)
slaveargs = json.dumps(slaveargs)
cmd = [sys.executable, *support.args_from_interpreter_flags(),
@@ -60,11 +55,18 @@ def run_test_in_subprocess(testname, ns):
def run_tests_slave(slaveargs):
- args, kwargs = json.loads(slaveargs)
- if kwargs.get('huntrleaks'):
+ ns_dict, testname = json.loads(slaveargs)
+ ns = types.SimpleNamespace(**ns_dict)
+
+ if ns.huntrleaks:
unittest.BaseTestSuite._cleanup = False
+
try:
- result = runtest(*args, **kwargs)
+ result = runtest_ns(testname, ns.verbose, ns.quiet, ns,
+ use_resources=ns.use_resources,
+ output_on_failure=ns.verbose3,
+ failfast=ns.failfast,
+ match_tests=ns.match_tests)
except KeyboardInterrupt:
result = INTERRUPTED, ''
except BaseException as e: