Skip to content

Commit 660df89

Browse files
committed
fix break_async test
1 parent c209a08 commit 660df89

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

Lib/test/test_pdb.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4591,21 +4591,28 @@ def test_async_break(self):
45914591
script = """
45924592
import asyncio
45934593
4594+
async def do_something():
4595+
test_str = "second break"
4596+
45944597
async def main():
4595-
print(f"Hello")
4596-
await asyncio.sleep(1)
4597-
print(f"World!")
4598+
test_str = "first break"
4599+
await do_something()
45984600
45994601
asyncio.run(main())
46004602
"""
46014603
commands = """
46024604
break main
4605+
break do_something
4606+
continue
46034607
continue
46044608
quit
46054609
"""
46064610
stdout, stderr = self.run_pdb_script(script, commands)
4607-
self.assertIn("Breakpoint 1 at", stdout)
4608-
self.assertIn("Hello", stdout)
4611+
print(stdout)
4612+
self.assertRegex(stdout, r"Breakpoint 1 at .*main\.py:8")
4613+
self.assertRegex(stdout, r"Breakpoint 2 at .*main\.py:5")
4614+
self.assertIn("first break", stdout)
4615+
self.assertIn("second break", stdout)
46094616

46104617

46114618
class ChecklineTests(unittest.TestCase):

0 commit comments

Comments
 (0)