We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb456a0 commit 8c38bd5Copy full SHA for 8c38bd5
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:
+ while True:
+ stack.enter_context(self.watcher())
360
361
362
class TestCodeObjectWatchers(unittest.TestCase):
0 commit comments