diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-08-20 23:41:57 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-08-20 23:41:57 (GMT) |
commit | 48ad7c0b01de1be182c3894e1691861ccffb82ea (patch) | |
tree | 85fc3421bdd9d61bd0f1c9c9ce19971052c81a4d /Lib/test/test_defaultdict.py | |
parent | 2b7ccbda900f9fc697aac6fdb72841c83ca640eb (diff) | |
download | cpython-48ad7c0b01de1be182c3894e1691861ccffb82ea.zip cpython-48ad7c0b01de1be182c3894e1691861ccffb82ea.tar.gz cpython-48ad7c0b01de1be182c3894e1691861ccffb82ea.tar.bz2 |
use __qualname__ to compute bound method repr (closes #21389)
Patch from Steven Barker.
Diffstat (limited to 'Lib/test/test_defaultdict.py')
-rw-r--r-- | Lib/test/test_defaultdict.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_defaultdict.py b/Lib/test/test_defaultdict.py index 532d535..48d1cb5 100644 --- a/Lib/test/test_defaultdict.py +++ b/Lib/test/test_defaultdict.py @@ -157,8 +157,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. |