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

gh-103186: Suppress and assert expected RuntimeWarnings#103244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Changes from1 commit
Commits
Show all changes
16 commits
Select commitHold shift + click to select a range
1eb3a31
Suppress and assert expected RuntimeWarnings
TabLandApr 4, 2023
cb3e785
Not possible to assert both a warning and error
TabLandApr 4, 2023
50fec2a
Remove accidentally added warnings import
TabLandApr 4, 2023
67feacd
📜🤖 Added by blurb_it.
blurb-it[bot]Apr 5, 2023
c9dd306
Run patchcheck.py
arhadthedevApr 6, 2023
289d2a6
Merge branch 'main' into fix-issue-103186.test_sys_settrace
TabLandJul 8, 2023
14afb6d
Merge branch 'main' into fix-issue-103186.test_sys_settrace
terryjreedyJul 10, 2023
58d38b0
Missed 2x tests that warn of unbound locals
TabLandAug 22, 2023
73d5589
Merge branch 'main' into fix-issue-103186.test_sys_settrace
TabLandAug 22, 2023
8c88dce
Improve wording and error type for failure edge case
TabLandSep 3, 2023
121948a
Correction: It is possible to assert both warnings and errors in tandem
TabLandSep 3, 2023
b3a6909
Use contextlib to simplify with statements and add tandem error and w…
TabLandSep 6, 2023
49d1951
Remove trailing spaces.
serhiy-storchakaSep 6, 2023
705941c
Remove self-tests.
serhiy-storchakaSep 6, 2023
cdfe8b1
Remove unused import
TabLandSep 6, 2023
b802670
Merge branch 'main' into fix-issue-103186.test_sys_settrace
TabLandSep 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Correction: It is possible to assert both warnings and errors in tandem
  • Loading branch information
@TabLand
TabLand committedSep 3, 2023
commit121948a5abc45f75f07927fcebeb0272392de315
6 changes: 4 additions & 2 deletionsLib/test/test_sys_settrace.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1949,7 +1949,8 @@ def run_test(self, func, jumpFrom, jumpTo, expected, error=None,
with self.assertRaisesRegex(*error):
func(output)
else:
raise NotImplementedError("Not currently possible to assert both a warning and an error in tandem, as one will be ignored by the unittest framework")
with self.assertRaisesRegex(*error) as error_context, self.assertWarnsRegex(*warning) as warning_context:
func(output)

sys.settrace(None)
self.compare_jump_output(expected, output)
Expand All@@ -1969,7 +1970,8 @@ def run_async_test(self, func, jumpFrom, jumpTo, expected, error=None,
with self.assertRaisesRegex(*error):
asyncio.run(func(output))
else:
raise NotImplementedError("Not currently possible to assert both a warning and an error in tandem, as one will be ignored by the unittest framework")
with self.assertRaisesRegex(*error) as error_context, self.assertWarnsRegex(*warning) as warning_context:
func(output)

sys.settrace(None)
asyncio.set_event_loop_policy(None)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp