Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfce93c8

Browse files
authored
gh-91051: fix type watcher test to be robust to existing watcher (#107989)
1 parent8891a88 commitfce93c8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎Lib/test/test_capi/test_watchers.py‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,10 @@ def test_clear_unassigned_watcher_id(self):
351351
self.clear_watcher(1)
352352

353353
deftest_no_more_ids_available(self):
354-
contexts= [self.watcher()foriinrange(self.TYPE_MAX_WATCHERS)]
355-
withExitStack()asstack:
356-
forctxincontexts:
357-
stack.enter_context(ctx)
358-
withself.assertRaisesRegex(RuntimeError,r"no more type watcher IDs"):
359-
self.add_watcher()
354+
withself.assertRaisesRegex(RuntimeError,r"no more type watcher IDs"):
355+
withExitStack()asstack:
356+
for_inrange(self.TYPE_MAX_WATCHERS+1):
357+
stack.enter_context(self.watcher())
360358

361359

362360
classTestCodeObjectWatchers(unittest.TestCase):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp