mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Make sure that the warnings filter is not reset or changed beyond the current
running test file. Closes issue2407. Thanks Jerry Seutter.
This commit is contained in:
parent
a0ce6b6b71
commit
48581c5f08
3 changed files with 24 additions and 36 deletions
|
@ -211,8 +211,8 @@ class TestVectorsTestCase(unittest.TestCase):
|
|||
def digest(self):
|
||||
return self._x.digest()
|
||||
|
||||
warnings.simplefilter('error', RuntimeWarning)
|
||||
try:
|
||||
with test_support.catch_warning():
|
||||
warnings.simplefilter('error', RuntimeWarning)
|
||||
try:
|
||||
hmac.HMAC('a', 'b', digestmod=MockCrazyHash)
|
||||
except RuntimeWarning:
|
||||
|
@ -227,8 +227,6 @@ class TestVectorsTestCase(unittest.TestCase):
|
|||
pass
|
||||
else:
|
||||
self.fail('Expected warning about small block_size')
|
||||
finally:
|
||||
warnings.resetwarnings()
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue