bpo-45205: Make test_compileall quiet (GH-28356)

Make test_compileall quiet: test_year_2038_mtime_compilation() and
test_larger_than_32_bit_times() of test_compileall no longer log
"Compiling ..." messages to stdout.
This commit is contained in:
Victor Stinner 2021-09-15 20:20:45 +02:00 committed by GitHub
parent e08e491a6c
commit cc057ff522
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,6 +91,7 @@ def test_year_2038_mtime_compilation(self):
os.utime(self.source_path, (2**32 - 1, 2**32 - 1))
except (OverflowError, OSError):
self.skipTest("filesystem doesn't support timestamps near 2**32")
with contextlib.redirect_stdout(io.StringIO()):
self.assertTrue(compileall.compile_file(self.source_path))
def test_larger_than_32_bit_times(self):
@ -100,6 +101,7 @@ def test_larger_than_32_bit_times(self):
os.utime(self.source_path, (2**35, 2**35))
except (OverflowError, OSError):
self.skipTest("filesystem doesn't support large timestamps")
with contextlib.redirect_stdout(io.StringIO()):
self.assertTrue(compileall.compile_file(self.source_path))
def recreation_check(self, metadata):