diff options
author | Kushal Das <kushaldas@gmail.com> | 2016-06-04 23:21:13 (GMT) |
---|---|---|
committer | Kushal Das <kushaldas@gmail.com> | 2016-06-04 23:21:13 (GMT) |
commit | 5801ecb4408cd11f6e6ffcb1612ca68d9936a728 (patch) | |
tree | d50a9aa79b55eb92dde2c12908d6ecb14fc7f1d5 /Lib/test/test_pprint.py | |
parent | 409482251b06fe75c4ee56e85ffbb4b23d934159 (diff) | |
download | cpython-5801ecb4408cd11f6e6ffcb1612ca68d9936a728.zip cpython-5801ecb4408cd11f6e6ffcb1612ca68d9936a728.tar.gz cpython-5801ecb4408cd11f6e6ffcb1612ca68d9936a728.tar.bz2 |
Issue #25548: Showing memory address of class objects in repl
Diffstat (limited to 'Lib/test/test_pprint.py')
-rw-r--r-- | Lib/test/test_pprint.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py index 7ebc298..2283923 100644 --- a/Lib/test/test_pprint.py +++ b/Lib/test/test_pprint.py @@ -848,12 +848,11 @@ bytearray(b'\\x00\\x01\\x02\\x03' def test_default_dict(self): d = collections.defaultdict(int) - self.assertEqual(pprint.pformat(d, width=1), "defaultdict(<class 'int'>, {})") + self.assertRegex(pprint.pformat(d, width=1), r"defaultdict\(<class 'int' at 0x.+>, {}\)") words = 'the quick brown fox jumped over a lazy dog'.split() d = collections.defaultdict(int, zip(words, itertools.count())) - self.assertEqual(pprint.pformat(d), -"""\ -defaultdict(<class 'int'>, + self.assertRegex(pprint.pformat(d), +r"""defaultdict\(<class 'int' at 0x.+>, {'a': 6, 'brown': 2, 'dog': 8, @@ -862,7 +861,7 @@ defaultdict(<class 'int'>, 'lazy': 7, 'over': 5, 'quick': 1, - 'the': 0})""") + 'the': 0}\)""") def test_counter(self): d = collections.Counter() |