We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8891a88 commit fce93c8Copy full SHA for fce93c8
Lib/test/test_capi/test_watchers.py
@@ -351,12 +351,10 @@ def test_clear_unassigned_watcher_id(self):
351
self.clear_watcher(1)
352
353
def test_no_more_ids_available(self):
354
- contexts = [self.watcher() for i in range(self.TYPE_MAX_WATCHERS)]
355
- with ExitStack() as stack:
356
- for ctx in contexts:
357
- stack.enter_context(ctx)
358
- with self.assertRaisesRegex(RuntimeError, r"no more type watcher IDs"):
359
- self.add_watcher()
+ with self.assertRaisesRegex(RuntimeError, r"no more type watcher IDs"):
+ with ExitStack() as stack:
+ for _ in range(self.TYPE_MAX_WATCHERS + 1):
+ stack.enter_context(self.watcher())
360
361
362
class TestCodeObjectWatchers(unittest.TestCase):
0 commit comments