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

Appearance settings

Commit 6ab541e

Browse filesBrowse files
Masorubka1youknowone
authored andcommitted
Update test_global.py from Cpython v3.11.2
1 parent 143036a commit 6ab541e
Copy full SHA for 6ab541e

File tree

1 file changed

+2
-9
lines changed
Filter options

1 file changed

+2
-9
lines changed

‎Lib/test/test_global.py

Copy file name to clipboardExpand all lines: Lib/test/test_global.py
+2-9Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@
99
class GlobalTests(unittest.TestCase):
1010

1111
def setUp(self):
12-
self._warnings_manager = check_warnings()
13-
self._warnings_manager.__enter__()
12+
self.enterContext(check_warnings())
1413
warnings.filterwarnings("error", module="<test string>")
1514

16-
def tearDown(self):
17-
self._warnings_manager.__exit__(None, None, None)
18-
19-
2015
def test1(self):
2116
prog_text_1 = """\
2217
def wrong1():
@@ -54,9 +49,7 @@ def test4(self):
5449

5550

5651
def setUpModule():
57-
cm = warnings.catch_warnings()
58-
cm.__enter__()
59-
unittest.addModuleCleanup(cm.__exit__, None, None, None)
52+
unittest.enterModuleContext(warnings.catch_warnings())
6053
warnings.filterwarnings("error", module="<test string>")
6154

6255

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.