mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-111051: [tests] Wait a second to support filesystems with low-resolution mtime (GH-121959)
This commit is contained in:
parent
bc264eac3a
commit
cad11a2bdc
1 changed files with 4 additions and 0 deletions
|
@ -3517,10 +3517,12 @@ def bœr():
|
||||||
print("hello")
|
print("hello")
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# the time.sleep is needed for low-resolution filesystems like HFS+
|
||||||
commands = """
|
commands = """
|
||||||
filename = $_frame.f_code.co_filename
|
filename = $_frame.f_code.co_filename
|
||||||
f = open(filename, "w")
|
f = open(filename, "w")
|
||||||
f.write("print('goodbye')")
|
f.write("print('goodbye')")
|
||||||
|
import time; time.sleep(1)
|
||||||
f.close()
|
f.close()
|
||||||
ll
|
ll
|
||||||
"""
|
"""
|
||||||
|
@ -3530,10 +3532,12 @@ def bœr():
|
||||||
self.assertIn("was edited", stdout)
|
self.assertIn("was edited", stdout)
|
||||||
|
|
||||||
def test_file_modified_after_execution_with_multiple_instances(self):
|
def test_file_modified_after_execution_with_multiple_instances(self):
|
||||||
|
# the time.sleep is needed for low-resolution filesystems like HFS+
|
||||||
script = """
|
script = """
|
||||||
import pdb; pdb.Pdb().set_trace()
|
import pdb; pdb.Pdb().set_trace()
|
||||||
with open(__file__, "w") as f:
|
with open(__file__, "w") as f:
|
||||||
f.write("print('goodbye')\\n" * 5)
|
f.write("print('goodbye')\\n" * 5)
|
||||||
|
import time; time.sleep(1)
|
||||||
import pdb; pdb.Pdb().set_trace()
|
import pdb; pdb.Pdb().set_trace()
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue