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.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 698507f..fa4c3ef 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -261,14 +261,6 @@ def open_urlresource(url):
fn, _ = urllib.urlretrieve(url, filename)
return open(fn)
-@contextlib.contextmanager
-def guard_warnings_filter():
- """Guard the warnings filter from being permanently changed."""
- original_filters = warnings.filters[:]
- try:
- yield
- finally:
- warnings.filters = original_filters
class WarningMessage(object):
"Holds the result of the latest showwarning() call"
@@ -292,7 +284,7 @@ def catch_warning():
Use like this:
- with catch_warning as w:
+ with catch_warning() as w:
warnings.warn("foo")
assert str(w.message) == "foo"
"""