summaryrefslogtreecommitdiff
path: root/Lib/test/test_reprlib.py
diff options
context:
space:
mode:
authorKushal Das <kushaldas@gmail.com>2016-06-04 16:21:13 -0700
committerKushal Das <kushaldas@gmail.com>2016-06-04 16:21:13 -0700
commit5801ecb4408cd11f6e6ffcb1612ca68d9936a728 (patch)
treed50a9aa79b55eb92dde2c12908d6ecb14fc7f1d5 /Lib/test/test_reprlib.py
parent409482251b06fe75c4ee56e85ffbb4b23d934159 (diff)
downloadcpython-git-5801ecb4408cd11f6e6ffcb1612ca68d9936a728.tar.gz
Issue #25548: Showing memory address of class objects in repl
Diffstat (limited to 'Lib/test/test_reprlib.py')
-rw-r--r--Lib/test/test_reprlib.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_reprlib.py b/Lib/test/test_reprlib.py
index 4bf91945ea..2ecea0221e 100644
--- a/Lib/test/test_reprlib.py
+++ b/Lib/test/test_reprlib.py
@@ -292,8 +292,8 @@ class foo(object):
''')
importlib.invalidate_caches()
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import foo
- eq(repr(foo.foo),
- "<class '%s.foo'>" % foo.__name__)
+ self.assertRegex(repr(foo.foo),
+ r"<class '%s.foo' at 0x.+>" % foo.__name__)
@unittest.skip('need a suitable object')
def test_object(self):
@@ -310,7 +310,7 @@ class bar:
importlib.invalidate_caches()
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar
# Module name may be prefixed with "test.", depending on how run.
- self.assertEqual(repr(bar.bar), "<class '%s.bar'>" % bar.__name__)
+ self.assertRegex(repr(bar.bar), r"<class '%s.bar' at 0x.+>" % bar.__name__)
def test_instance(self):
self._check_path_limitations('baz')