diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-09-30 11:51:17 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-09-30 11:51:17 (GMT) |
commit | 9a14214aee22512f833a8d5cf8627ca45627d330 (patch) | |
tree | 6a29bd8b89aa2834b6cabd5e584a43e6c54c0aa2 /Lib/test/libregrtest | |
parent | 38031143fbab6267fe464a1cb39eeb5c68de38f4 (diff) | |
download | cpython-9a14214aee22512f833a8d5cf8627ca45627d330.zip cpython-9a14214aee22512f833a8d5cf8627ca45627d330.tar.gz cpython-9a14214aee22512f833a8d5cf8627ca45627d330.tar.bz2 |
Issue #25220: Fix "-m test --forever"
* Fix "-m test --forever": replace _test_forever() with self._test_forever()
* Add unit test for --forever
* Add unit test for a failing test
* Fix also some pyflakes warnings in libregrtest
Diffstat (limited to 'Lib/test/libregrtest')
-rw-r--r-- | Lib/test/libregrtest/main.py | 2 | ||||
-rw-r--r-- | Lib/test/libregrtest/refleak.py | 6 | ||||
-rw-r--r-- | Lib/test/libregrtest/runtest_mp.py | 3 |
3 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py index fdb925d..e1a99fb 100644 --- a/Lib/test/libregrtest/main.py +++ b/Lib/test/libregrtest/main.py @@ -319,7 +319,7 @@ class Regrtest: def run_tests(self): if self.ns.forever: - self.tests = _test_forever(list(self.selected)) + self.tests = self._test_forever(list(self.selected)) self.test_count = '' self.test_count_width = 3 else: diff --git a/Lib/test/libregrtest/refleak.py b/Lib/test/libregrtest/refleak.py index db8a445..9be0dec 100644 --- a/Lib/test/libregrtest/refleak.py +++ b/Lib/test/libregrtest/refleak.py @@ -46,6 +46,8 @@ def dash_R(the_module, test, indirect_test, huntrleaks): print("beginning", repcount, "repetitions", file=sys.stderr) print(("1234567890"*(repcount//10 + 1))[:repcount], file=sys.stderr, flush=True) + # initialize variables to make pyflakes quiet + rc_before = alloc_before = 0 for i in range(repcount): indirect_test() alloc_after, rc_after = dash_R_cleanup(fs, ps, pic, zdc, abcs) @@ -158,6 +160,6 @@ def warm_caches(): for i in range(256): s[i:i+1] # unicode cache - x = [chr(i) for i in range(256)] + [chr(i) for i in range(256)] # int cache - x = list(range(-5, 257)) + list(range(-5, 257)) diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py index b31b51e..a732d70 100644 --- a/Lib/test/libregrtest/runtest_mp.py +++ b/Lib/test/libregrtest/runtest_mp.py @@ -5,7 +5,6 @@ import sys import time import traceback import types -import unittest from test import support try: import threading @@ -173,7 +172,7 @@ def run_tests_multiprocess(regrtest): try: while finished < regrtest.ns.use_mp: try: - item = output.get(timeout=PROGRESS_UPDATE) + item = output.get(timeout=timeout) except queue.Empty: running = get_running(workers) if running: |