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

Skip to content

Commit cad11a2

Browse files
authored
gh-111051: [tests] Wait a second to support filesystems with low-resolution mtime (GH-121959)
1 parent bc264ea commit cad11a2

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
@@ -3517,10 +3517,12 @@ def test_file_modified_after_execution(self):
35173517
print("hello")
35183518
"""
35193519

3520+
# the time.sleep is needed for low-resolution filesystems like HFS+
35203521
commands = """
35213522
filename = $_frame.f_code.co_filename
35223523
f = open(filename, "w")
35233524
f.write("print('goodbye')")
3525+
import time; time.sleep(1)
35243526
f.close()
35253527
ll
35263528
"""
@@ -3530,10 +3532,12 @@ def test_file_modified_after_execution(self):
35303532
self.assertIn("was edited", stdout)
35313533

35323534
def test_file_modified_after_execution_with_multiple_instances(self):
3535+
# the time.sleep is needed for low-resolution filesystems like HFS+
35333536
script = """
35343537
import pdb; pdb.Pdb().set_trace()
35353538
with open(__file__, "w") as f:
35363539
f.write("print('goodbye')\\n" * 5)
3540+
import time; time.sleep(1)
35373541
import pdb; pdb.Pdb().set_trace()
35383542
"""
35393543

0 commit comments

Comments
 (0)