]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111051: [tests] Wait a second to support filesystems with low-resolution mtime...
authorŁukasz Langa <lukasz@langa.pl>
Mon, 22 Jul 2024 11:03:07 +0000 (13:03 +0200)
committerGitHub <noreply@github.com>
Mon, 22 Jul 2024 11:03:07 +0000 (13:03 +0200)
Lib/test/test_pdb.py

index f71856d3603d735095ef9d6ffc4038f2399404b9..9395e9b133f50dbda47c279d41d773d9ca209689 100644 (file)
@@ -3517,10 +3517,12 @@ def bœr():
             print("hello")
         """
 
+        # the time.sleep is needed for low-resolution filesystems like HFS+
         commands = """
             filename = $_frame.f_code.co_filename
             f = open(filename, "w")
             f.write("print('goodbye')")
+            import time; time.sleep(1)
             f.close()
             ll
         """
@@ -3530,10 +3532,12 @@ def bœr():
         self.assertIn("was edited", stdout)
 
     def test_file_modified_after_execution_with_multiple_instances(self):
+        # the time.sleep is needed for low-resolution filesystems like HFS+
         script = """
             import pdb; pdb.Pdb().set_trace()
             with open(__file__, "w") as f:
                 f.write("print('goodbye')\\n" * 5)
+                import time; time.sleep(1)
             import pdb; pdb.Pdb().set_trace()
         """