]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-111051: [tests] Wait a second to support filesystems with low-resolution...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 12 Aug 2024 11:00:33 +0000 (13:00 +0200)
committerGitHub <noreply@github.com>
Mon, 12 Aug 2024 11:00:33 +0000 (11:00 +0000)
(cherry picked from commit cad11a2bdceb6d4683ae5654ce555cdf5f191217)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Lib/test/test_pdb.py

index 8654d8e66f7e644c6f8393b4e87b0be176839385..9b2c885ed67f85c25b6ad486d4db2ed0a2e9d466 100644 (file)
@@ -3416,10 +3416,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
         """
@@ -3429,10 +3431,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()
         """