diff options
Diffstat (limited to 'Lib/test/test_defaultdict.py')
-rw-r--r-- | Lib/test/test_defaultdict.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/test/test_defaultdict.py b/Lib/test/test_defaultdict.py index 532d535..a90bc2b 100644 --- a/Lib/test/test_defaultdict.py +++ b/Lib/test/test_defaultdict.py @@ -5,7 +5,6 @@ import copy import pickle import tempfile import unittest -from test import support from collections import defaultdict @@ -157,8 +156,9 @@ class TestDefaultDict(unittest.TestCase): def _factory(self): return [] d = sub() - self.assertTrue(repr(d).startswith( - "defaultdict(<bound method sub._factory of defaultdict(...")) + self.assertRegex(repr(d), + r"defaultdict\(<bound method .*sub\._factory " + r"of defaultdict\(\.\.\., \{\}\)>, \{\}\)") # NOTE: printing a subclass of a builtin type does not call its # tp_print slot. So this part is essentially the same test as above. @@ -183,8 +183,5 @@ class TestDefaultDict(unittest.TestCase): o = pickle.loads(s) self.assertEqual(d, o) -def test_main(): - support.run_unittest(TestDefaultDict) - if __name__ == "__main__": - test_main() + unittest.main() |