diff options
author | Brett Cannon <bcannon@gmail.com> | 2010-03-20 21:55:48 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2010-03-20 21:55:48 (GMT) |
commit | 241bd9827b4b29813088249fbd22a8e969e5b393 (patch) | |
tree | 13f5745e9c71ce9cd30871a202974f542c650743 /Lib/test/test_set.py | |
parent | c8d502eab736c9167fcf4cde76a59caafd617eb8 (diff) | |
download | cpython-241bd9827b4b29813088249fbd22a8e969e5b393.zip cpython-241bd9827b4b29813088249fbd22a8e969e5b393.tar.gz cpython-241bd9827b4b29813088249fbd22a8e969e5b393.tar.bz2 |
Clean up the warnings filter use in test_set.
Diffstat (limited to 'Lib/test/test_set.py')
-rw-r--r-- | Lib/test/test_set.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index f4d1f6a..1e0a909 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -907,7 +907,8 @@ class TestBasicOpsBytes(TestBasicOps): class TestBasicOpsMixedStringBytes(TestBasicOps): def setUp(self): - self.warning_filters = warnings.filters[:] + self._warning_filters = support.check_warnings() + self._warning_filters.__enter__() warnings.simplefilter('ignore', BytesWarning) self.case = "string and bytes set" self.values = ["a", "b", b"a", b"b"] @@ -917,7 +918,7 @@ class TestBasicOpsMixedStringBytes(TestBasicOps): self.repr = "{'a', b'a', 'b', b'b'}" def tearDown(self): - warnings.filters = self.warning_filters + self._warning_filters.__exit__(None, None, None) #============================================================================== |