summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2016-07-21 19:34:01 -0400
committerMike Gilbert <floppym@gentoo.org>2016-07-21 19:34:01 -0400
commit9df03d81ee18965f4dc8c507997ec7d87a2f53c7 (patch)
tree799c720d73539c14804c154d7cf5e9bec12c41e3 /patches/22_all_tests_environment.patch
parentUpdate patches for 3.4.4 (myself!) (diff)
downloadpython-gentoo-patches-3.4.5.tar.gz
python-gentoo-patches-3.4.5.tar.bz2
python-gentoo-patches-3.4.5.zip
Updates from Arfrever3.4.5-03.4.5
Diffstat (limited to 'patches/22_all_tests_environment.patch')
-rw-r--r--patches/22_all_tests_environment.patch45
1 files changed, 21 insertions, 24 deletions
diff --git a/patches/22_all_tests_environment.patch b/patches/22_all_tests_environment.patch
index 6eb75f8..017bb86 100644
--- a/patches/22_all_tests_environment.patch
+++ b/patches/22_all_tests_environment.patch
@@ -2,7 +2,7 @@ https://bugs.python.org/issue1674555
--- Lib/site.py
+++ Lib/site.py
-@@ -545,8 +545,12 @@
+@@ -547,8 +547,12 @@
known_paths = venv(known_paths)
if ENABLE_USER_SITE is None:
ENABLE_USER_SITE = check_enableusersite()
@@ -35,19 +35,16 @@ https://bugs.python.org/issue1674555
base_cmd = ([sys.executable] + support.args_from_interpreter_flags() +
['-X', 'faulthandler', '-m', 'test.regrtest'])
-@@ -643,6 +643,56 @@
+@@ -643,9 +643,60 @@
support.use_resources = ns.use_resources
save_modules = sys.modules.keys()
-+ opt_args = support.args_from_interpreter_flags()
-+ base_cmd = [sys.executable] + opt_args
-+ base_cmd += ['-X', 'faulthandler', '-m', 'test.regrtest']
-+ debug_output_pat = re.compile(r"\[\d+ refs, \d+ blocks\]$")
-+
+ def _runtest(test, verbose, quiet, huntrleaks=False, use_resources=None,
+ output_on_failure=False, failfast=False, match_tests=None,
+ timeout=None):
+ if test == "test_site":
++ base_cmd = ([sys.executable] + support.args_from_interpreter_flags() +
++ ['-X', 'faulthandler', '-m', 'test.regrtest'])
+ slaveargs = ((test, verbose, quiet),
+ dict(huntrleaks=huntrleaks,
+ use_resources=use_resources,
@@ -63,23 +60,26 @@ https://bugs.python.org/issue1674555
+ stdout=PIPE, stderr=PIPE,
+ universal_newlines=True,
+ close_fds=(os.name != 'nt'),
++ cwd=support.SAVEDCWD,
+ env=env)
+ stdout, stderr = popen.communicate()
+ retcode = popen.wait()
-+ # Strip last refcount output line if it exists, since it
-+ # comes from the shutdown of the interpreter in the subcommand.
-+ stderr = debug_output_pat.sub("", stderr)
+ stdout, _, result = stdout.strip().rpartition("\n")
+ if retcode != 0:
-+ result = (CHILD_ERROR, "Exit code %s" % retcode)
++ result = (CHILD_ERROR, None)
+ else:
++ if not result:
++ return (None, None)
+ result = json.loads(result)
++ stdout = stdout.rstrip()
++ stderr = stderr.rstrip()
+ if stdout:
+ print(stdout)
+ if stderr:
+ print(stderr, file=sys.stderr)
++ sys.stdout.flush()
++ sys.stderr.flush()
+ if result[0] == INTERRUPTED:
-+ assert result[1] == 'KeyboardInterrupt'
+ raise KeyboardInterrupt
+ return result
+ else:
@@ -91,16 +91,13 @@ https://bugs.python.org/issue1674555
+
def accumulate_result(test, result):
ok, test_time = result
- test_times.append((test_time, test))
-@@ -680,7 +730,6 @@
- print("Multiprocess option requires thread support")
- sys.exit(2)
- from queue import Queue
-- debug_output_pat = re.compile(r"\[\d+ refs, \d+ blocks\]$")
- output = Queue()
- pending = MultiprocessTests(tests)
- def work():
-@@ -752,15 +801,15 @@
+- test_times.append((test_time, test))
++ if ok not in (None, CHILD_ERROR, INTERRUPTED):
++ test_times.append((test_time, test))
+ if ok == PASSED:
+ good.append(test)
+ elif ok == FAILED:
+@@ -752,15 +803,15 @@
if ns.trace:
# If we're tracing code coverage, then we don't exit with status
# if on a false return value from main.
@@ -122,7 +119,7 @@ https://bugs.python.org/issue1674555
accumulate_result(test, result)
except KeyboardInterrupt:
interrupted = True
-@@ -817,8 +866,8 @@
+@@ -815,8 +866,8 @@
sys.stdout.flush()
try:
ns.verbose = True
@@ -133,7 +130,7 @@ https://bugs.python.org/issue1674555
except KeyboardInterrupt:
# print a newline separate from the ^C
print()
-@@ -1239,8 +1288,9 @@
+@@ -1238,8 +1289,9 @@
for name, get, restore in self.resource_info():
current = get()
original = saved_values.pop(name)