Skip to content

Commit

Permalink
bpo-45205: Make test_compileall quiet (GH-28356) (GH-28370)
Browse files Browse the repository at this point in the history
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.
(cherry picked from commit cc057ff)

Co-authored-by: Victor Stinner <vstinner@python.org>
  • Loading branch information
miss-islington and vstinner committed Sep 15, 2021
1 parent bbaf5c2 commit 17000b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Lib/test/test_compileall.py
Expand Up @@ -91,7 +91,8 @@ 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")
self.assertTrue(compileall.compile_file(self.source_path))
with contextlib.redirect_stdout(io.StringIO()):
self.assertTrue(compileall.compile_file(self.source_path))

def test_larger_than_32_bit_times(self):
# This is similar to the test above but we skip it if the OS doesn't
Expand All @@ -100,7 +101,8 @@ 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")
self.assertTrue(compileall.compile_file(self.source_path))
with contextlib.redirect_stdout(io.StringIO()):
self.assertTrue(compileall.compile_file(self.source_path))

def recreation_check(self, metadata):
"""Check that compileall recreates bytecode when the new metadata is
Expand Down

0 comments on commit 17000b5

Please sign in to comment.