fix test_unittest: ignore DeprecationWarning on assertDictContainsSubset()
This commit is contained in:
parent
47f14bade8
commit
cae969e70a
@ -1,5 +1,5 @@
|
||||
import datetime
|
||||
|
||||
import warnings
|
||||
import unittest
|
||||
|
||||
|
||||
@ -224,6 +224,9 @@ class TestLongMessage(unittest.TestCase):
|
||||
"\+ \{'key': 'value'\} : oops$"])
|
||||
|
||||
def testAssertDictContainsSubset(self):
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", DeprecationWarning)
|
||||
|
||||
self.assertMessages('assertDictContainsSubset', ({'key': 'value'}, {}),
|
||||
["^Missing: 'key'$", "^oops$",
|
||||
"^Missing: 'key'$",
|
||||
|
@ -489,6 +489,9 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
|
||||
animals)
|
||||
|
||||
def testAssertDictContainsSubset(self):
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", DeprecationWarning)
|
||||
|
||||
self.assertDictContainsSubset({}, {})
|
||||
self.assertDictContainsSubset({}, {'a': 1})
|
||||
self.assertDictContainsSubset({'a': 1}, {'a': 1})
|
||||
|
Loading…
x
Reference in New Issue
Block a user