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
"""
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()
"""