mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Clean up the warnings filter use in test_set.
This commit is contained in:
parent
c8d502eab7
commit
241bd9827b
1 changed files with 3 additions and 2 deletions
|
@ -907,7 +907,8 @@ class TestBasicOpsBytes(TestBasicOps):
|
||||||
|
|
||||||
class TestBasicOpsMixedStringBytes(TestBasicOps):
|
class TestBasicOpsMixedStringBytes(TestBasicOps):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.warning_filters = warnings.filters[:]
|
self._warning_filters = support.check_warnings()
|
||||||
|
self._warning_filters.__enter__()
|
||||||
warnings.simplefilter('ignore', BytesWarning)
|
warnings.simplefilter('ignore', BytesWarning)
|
||||||
self.case = "string and bytes set"
|
self.case = "string and bytes set"
|
||||||
self.values = ["a", "b", b"a", b"b"]
|
self.values = ["a", "b", b"a", b"b"]
|
||||||
|
@ -917,7 +918,7 @@ class TestBasicOpsMixedStringBytes(TestBasicOps):
|
||||||
self.repr = "{'a', b'a', 'b', b'b'}"
|
self.repr = "{'a', b'a', 'b', b'b'}"
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
warnings.filters = self.warning_filters
|
self._warning_filters.__exit__(None, None, None)
|
||||||
|
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue