mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-125600: Only show stale code warning on source code display commands (#125601)
This commit is contained in:
parent
7cf2dbc3cb
commit
77cebb1ce9
3 changed files with 40 additions and 4 deletions
|
@ -3711,6 +3711,25 @@ def bœr():
|
|||
self.assertIn("WARNING:", stdout)
|
||||
self.assertIn("was edited", stdout)
|
||||
|
||||
def test_file_modified_and_immediately_restarted(self):
|
||||
script = """
|
||||
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()
|
||||
restart
|
||||
"""
|
||||
|
||||
stdout, stderr = self.run_pdb_script(script, commands)
|
||||
self.assertNotIn("WARNING:", stdout)
|
||||
self.assertNotIn("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 = """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue