diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-03 23:56:12 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-01-03 23:56:12 (GMT) |
commit | cae969e70afd4e02d9543c3a18f089a1c66de982 (patch) | |
tree | ee49f6241ad61f55f024d3d36b91ea56f8806d51 /Lib/unittest/test/test_assertions.py | |
parent | 47f14bade8f1d9517fca4bcddb1162f4e9845e12 (diff) | |
download | cpython-cae969e70afd4e02d9543c3a18f089a1c66de982.zip cpython-cae969e70afd4e02d9543c3a18f089a1c66de982.tar.gz cpython-cae969e70afd4e02d9543c3a18f089a1c66de982.tar.bz2 |
fix test_unittest: ignore DeprecationWarning on assertDictContainsSubset()
Diffstat (limited to 'Lib/unittest/test/test_assertions.py')
-rw-r--r-- | Lib/unittest/test/test_assertions.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/unittest/test/test_assertions.py b/Lib/unittest/test/test_assertions.py index e5dc9fa..a1d20eb 100644 --- a/Lib/unittest/test/test_assertions.py +++ b/Lib/unittest/test/test_assertions.py @@ -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"), |