def assertDictContainsSubset(self, subset, dictionary, msg=None):
"""Checks whether dictionary is a superset of subset."""
warnings.warn('assertDictContainsSubset is deprecated',
- DeprecationWarning)
+ DeprecationWarning,
+ stacklevel=2)
missing = []
mismatched = []
for key, value in subset.items():
with self.assertRaises(self.failureException):
self.assertDictContainsSubset({'foo': one}, {'foo': '\uFFFD'})
+ with self.assertWarns(DeprecationWarning) as warninfo:
+ self.assertDictContainsSubset({}, {})
+ self.assertEqual(warninfo.warnings[0].filename, __file__)
+
def testAssertEqual(self):
equal_pairs = [
((), ()),
--- /dev/null
+Ensure deprecation warning from :func:`assertDictContainsSubset` points at
+calling code - by Anthony Sottile.