Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b64ce4

Browse files
miss-islingtonambv
andauthored
[3.13] gh-111051: [tests] Wait a second to support filesystems with low-resolution mtime (GH-121959) (GH-122114)
(cherry picked from commit cad11a2) Co-authored-by: Łukasz Langa <[email protected]>
1 parent d6d68cf commit 8b64ce4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_pdb.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3416,10 +3416,12 @@ def test_file_modified_after_execution(self):
34163416
print("hello")
34173417
"""
34183418

3419+
# the time.sleep is needed for low-resolution filesystems like HFS+
34193420
commands = """
34203421
filename = $_frame.f_code.co_filename
34213422
f = open(filename, "w")
34223423
f.write("print('goodbye')")
3424+
import time; time.sleep(1)
34233425
f.close()
34243426
ll
34253427
"""
@@ -3429,10 +3431,12 @@ def test_file_modified_after_execution(self):
34293431
self.assertIn("was edited", stdout)
34303432

34313433
def test_file_modified_after_execution_with_multiple_instances(self):
3434+
# the time.sleep is needed for low-resolution filesystems like HFS+
34323435
script = """
34333436
import pdb; pdb.Pdb().set_trace()
34343437
with open(__file__, "w") as f:
34353438
f.write("print('goodbye')\\n" * 5)
3439+
import time; time.sleep(1)
34363440
import pdb; pdb.Pdb().set_trace()
34373441
"""
34383442

0 commit comments

Comments
 (0)