Skip to content

Commit

Permalink
pythongh-111051: [tests] Wait a second to support filesystems with lo…
Browse files Browse the repository at this point in the history
…w-resolution mtime (pythonGH-121959)

(cherry picked from commit cad11a2)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
  • Loading branch information
ambv authored and miss-islington committed Jul 22, 2024
1 parent 82db815 commit af0ad6e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3416,10 +3416,12 @@ def test_file_modified_after_execution(self):
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
"""
Expand All @@ -3429,10 +3431,12 @@ def test_file_modified_after_execution(self):
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()
"""

Expand Down

0 comments on commit af0ad6e

Please sign in to comment.