mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Update test_global.py from Cpython v3.11.2
This commit is contained in:
1 parent
143036aa0a
commit
6ab541ea4e
1 file changed
+2
-9
Vendored
+2
-9
@@ -9,14 +9,9 @@ import warnings
|
||||
class GlobalTests(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self._warnings_manager = check_warnings()
|
||||
self._warnings_manager.__enter__()
|
||||
self.enterContext(check_warnings())
|
||||
warnings.filterwarnings("error", module="<test string>")
|
||||
|
||||
def tearDown(self):
|
||||
self._warnings_manager.__exit__(None, None, None)
|
||||
|
||||
|
||||
def test1(self):
|
||||
prog_text_1 = """\
|
||||
def wrong1():
|
||||
@@ -54,9 +49,7 @@ x = 2
|
||||
|
||||
|
||||
def setUpModule():
|
||||
cm = warnings.catch_warnings()
|
||||
cm.__enter__()
|
||||
unittest.addModuleCleanup(cm.__exit__, None, None, None)
|
||||
unittest.enterModuleContext(warnings.catch_warnings())
|
||||
warnings.filterwarnings("error", module="<test string>")
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user