diff options
Diffstat (limited to 'Lib/test')
| -rwxr-xr-x | Lib/test/regrtest.py | 8 | ||||
| -rw-r--r-- | Lib/test/test_warnings.py | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 7077787..cb55b47 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -399,11 +399,6 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, if module not in save_modules and module.startswith("test."): test_support.unload(module) - # The lists won't be sorted if running with -r - good.sort() - bad.sort() - skipped.sort() - if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", @@ -757,7 +752,8 @@ def printlist(x, width=70, indent=4): from textwrap import fill blanks = ' ' * indent - print fill(' '.join(map(str, x)), width, + # Print the sorted list: 'x' may be a '--random' list or a set() + print fill(' '.join(str(elt) for elt in sorted(x)), width, initial_indent=blanks, subsequent_indent=blanks) # Map sys.platform to a string containing the basenames of tests diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py index 71944cd..fab8086 100644 --- a/Lib/test/test_warnings.py +++ b/Lib/test/test_warnings.py @@ -37,11 +37,15 @@ def warnings_state(module): except NameError: pass original_warnings = warning_tests.warnings + original_filters = module.filters try: + module.filters = original_filters[:] + module.simplefilter("once") warning_tests.warnings = module yield finally: warning_tests.warnings = original_warnings + module.filters = original_filters class BaseTest(unittest.TestCase): @@ -204,6 +208,7 @@ class WarnTests(unittest.TestCase): def test_message(self): with original_warnings.catch_warnings(record=True, module=self.module) as w: + self.module.simplefilter("once") for i in range(4): text = 'multi %d' %i # Different text on each call. self.module.warn(text) |
