summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 695bd6d..0bf22cf 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -18,7 +18,7 @@ __all__ = ["Error", "TestFailed", "TestSkipped", "ResourceDenied", "import_modul
"is_resource_enabled", "requires", "find_unused_port", "bind_port",
"fcmp", "have_unicode", "is_jython", "TESTFN", "HOST", "FUZZ",
"findfile", "verify", "vereq", "sortdict", "check_syntax_error",
- "open_urlresource", "catch_warning", "CleanImport",
+ "open_urlresource", "CleanImport",
"EnvironmentVarGuard", "captured_output",
"captured_stdout", "TransientResource", "transient_internet",
"run_with_locale", "set_memlimit", "bigmemtest", "bigaddrspacetest",
@@ -52,7 +52,7 @@ class ResourceDenied(TestSkipped):
def import_module(name, deprecated=False):
"""Import the module to be tested, raising TestSkipped if it is not
available."""
- with catch_warning(record=False):
+ with warnings.catch_warnings():
if deprecated:
warnings.filterwarnings("ignore", ".+ (module|package)",
DeprecationWarning)
@@ -381,10 +381,6 @@ def open_urlresource(url):
return open(fn)
-def catch_warning(module=warnings, record=True):
- return warnings.catch_warnings(record=record, module=module)
-
-
class CleanImport(object):
"""Context manager to force import to return a new module reference.