diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-30 23:06:06 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-30 23:06:06 (GMT) |
commit | c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9 (patch) | |
tree | 6350dab0b481e6de307dc4e043c6230f463a9ca7 /Lib/test/test_defaultdict.py | |
parent | 98d23f2e065713ccfbc07d9a0b65f737a212bfb5 (diff) | |
download | cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.zip cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.gz cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.bz2 |
convert old fail* assertions to assert*
Diffstat (limited to 'Lib/test/test_defaultdict.py')
-rw-r--r-- | Lib/test/test_defaultdict.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Lib/test/test_defaultdict.py b/Lib/test/test_defaultdict.py index 00bd9dc..35468b4 100644 --- a/Lib/test/test_defaultdict.py +++ b/Lib/test/test_defaultdict.py @@ -25,21 +25,21 @@ class TestDefaultDict(unittest.TestCase): d1[13] d1[14] self.assertEqual(d1, {12: [42, 24], 13: [], 14: []}) - self.assert_(d1[12] is not d1[13] is not d1[14]) + self.assertTrue(d1[12] is not d1[13] is not d1[14]) d2 = defaultdict(list, foo=1, bar=2) self.assertEqual(d2.default_factory, list) self.assertEqual(d2, {"foo": 1, "bar": 2}) self.assertEqual(d2["foo"], 1) self.assertEqual(d2["bar"], 2) self.assertEqual(d2[42], []) - self.assert_("foo" in d2) - self.assert_("foo" in d2.keys()) - self.assert_("bar" in d2) - self.assert_("bar" in d2.keys()) - self.assert_(42 in d2) - self.assert_(42 in d2.keys()) - self.assert_(12 not in d2) - self.assert_(12 not in d2.keys()) + self.assertTrue("foo" in d2) + self.assertTrue("foo" in d2.keys()) + self.assertTrue("bar" in d2) + self.assertTrue("bar" in d2.keys()) + self.assertTrue(42 in d2) + self.assertTrue(42 in d2.keys()) + self.assertTrue(12 not in d2) + self.assertTrue(12 not in d2.keys()) d2.default_factory = None self.assertEqual(d2.default_factory, None) try: @@ -68,7 +68,7 @@ class TestDefaultDict(unittest.TestCase): self.assertEqual(repr(d2), "defaultdict(<class 'int'>, {12: 42})") def foo(): return 43 d3 = defaultdict(foo) - self.assert_(d3.default_factory is foo) + self.assertTrue(d3.default_factory is foo) d3[13] self.assertEqual(repr(d3), "defaultdict(%s, {13: 43})" % repr(foo)) @@ -127,7 +127,7 @@ class TestDefaultDict(unittest.TestCase): d2 = copy.deepcopy(d1) self.assertEqual(d2.default_factory, foobar) self.assertEqual(d2, d1) - self.assert_(d1[1] is not d2[1]) + self.assertTrue(d1[1] is not d2[1]) d1.default_factory = list d2 = copy.deepcopy(d1) self.assertEqual(d2.default_factory, list) @@ -150,7 +150,7 @@ class TestDefaultDict(unittest.TestCase): def _factory(self): return [] d = sub() - self.assert_(repr(d).startswith( + self.assertTrue(repr(d).startswith( "defaultdict(<bound method sub._factory of defaultdict(...")) # NOTE: printing a subclass of a builtin type does not call its |