mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue #25548: Showing memory address of class objects in repl
This commit is contained in:
parent
409482251b
commit
5801ecb440
20 changed files with 106 additions and 92 deletions
|
@ -127,7 +127,10 @@ class CmdLineTest(unittest.TestCase):
|
|||
print(printed_package)
|
||||
print(printed_argv0)
|
||||
print(printed_cwd)
|
||||
self.assertIn(printed_loader.encode('utf-8'), data)
|
||||
expected = printed_loader.encode('utf-8')
|
||||
idx = expected.find(b"at 0x")
|
||||
expected = expected[:idx]
|
||||
self.assertIn(expected, data)
|
||||
self.assertIn(printed_file.encode('utf-8'), data)
|
||||
self.assertIn(printed_package.encode('utf-8'), data)
|
||||
self.assertIn(printed_argv0.encode('utf-8'), data)
|
||||
|
@ -158,6 +161,8 @@ class CmdLineTest(unittest.TestCase):
|
|||
def test_dash_c_loader(self):
|
||||
rc, out, err = assert_python_ok("-c", "print(__loader__)")
|
||||
expected = repr(importlib.machinery.BuiltinImporter).encode("utf-8")
|
||||
idx = expected.find(b"at 0x")
|
||||
expected = expected[:idx]
|
||||
self.assertIn(expected, out)
|
||||
|
||||
def test_stdin_loader(self):
|
||||
|
@ -171,6 +176,8 @@ class CmdLineTest(unittest.TestCase):
|
|||
finally:
|
||||
out = kill_python(p)
|
||||
expected = repr(importlib.machinery.BuiltinImporter).encode("utf-8")
|
||||
idx = expected.find(b"at 0x")
|
||||
expected = expected[:idx]
|
||||
self.assertIn(expected, out)
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue