summaryrefslogtreecommitdiff
path: root/Lib/unittest/test/test_assertions.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2022-01-26 20:39:15 -0800
committerGitHub <noreply@github.com>2022-01-26 20:39:15 -0800
commitb50322d20337ca468f2070eedb051a16ee1eba94 (patch)
treeba478b8fe2b91b583cec640d518f9643fb5b6f7d /Lib/unittest/test/test_assertions.py
parent9f0881476e0113d3a35e0ffa96649b9276dd75c5 (diff)
downloadcpython-git-b50322d20337ca468f2070eedb051a16ee1eba94.tar.gz
bpo-45162: Revert "Remove many old deprecated unittest features" (GH-30935)
Revert "bpo-45162: Remove many old deprecated unittest features (GH-28268)" This reverts commit b0a6ede3d0bd6fa4ffe413ab4dfc1059201df25b. We're deferring this change until 3.12 while upstream projects that use the legacy assertion method names are fixed. See the issue for links to the discussion. Many upstream projects now have issues and PRs filed.
Diffstat (limited to 'Lib/unittest/test/test_assertions.py')
-rw-r--r--Lib/unittest/test/test_assertions.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_assertions.py b/Lib/unittest/test/test_assertions.py
index 6557104b81..a0db3423b8 100644
--- a/Lib/unittest/test/test_assertions.py
+++ b/Lib/unittest/test/test_assertions.py
@@ -271,6 +271,15 @@ class TestLongMessage(unittest.TestCase):
r"\+ \{'key': 'value'\}$",
r"\+ \{'key': 'value'\} : oops$"])
+ def testAssertDictContainsSubset(self):
+ 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"),
[r"\+ foo$", "^oops$",