Skip to content
Prev Previous commit
Next Next commit
Fix test
  • Loading branch information
asvetlov committed Feb 9, 2025
commit 4e09df89fec8fc9b86d64879c505455b2f4e1a49
8 changes: 6 additions & 2 deletions Lib/test/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,13 @@ def test_token_contextmanager_reentrant(self):

def fun():
token = c.set(36)
with token:
with self.assertRaisesRegex(
RuntimeError,
"<Token .+ has already been used once"
):
with token:
self.assertEqual(c.get(), 36)
with token:
self.assertEqual(c.get(), 36)

self.assertEqual(c.get(), 42)

Expand Down
Loading