mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
fix test_unittest: ignore DeprecationWarning on assertDictContainsSubset()
This commit is contained in:
parent
47f14bade8
commit
cae969e70a
2 changed files with 30 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
|||
import datetime
|
||||
|
||||
import warnings
|
||||
import unittest
|
||||
|
||||
|
||||
|
@ -224,10 +224,13 @@ class TestLongMessage(unittest.TestCase):
|
|||
"\+ \{'key': 'value'\} : oops$"])
|
||||
|
||||
def testAssertDictContainsSubset(self):
|
||||
self.assertMessages('assertDictContainsSubset', ({'key': 'value'}, {}),
|
||||
["^Missing: 'key'$", "^oops$",
|
||||
"^Missing: 'key'$",
|
||||
"^Missing: 'key' : oops$"])
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", DeprecationWarning)
|
||||
|
||||
self.assertMessages('assertDictContainsSubset', ({'key': 'value'}, {}),
|
||||
["^Missing: 'key'$", "^oops$",
|
||||
"^Missing: 'key'$",
|
||||
"^Missing: 'key' : oops$"])
|
||||
|
||||
def testAssertMultiLineEqual(self):
|
||||
self.assertMessages('assertMultiLineEqual', ("", "foo"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue