MCPcopy Index your code
hub / github.com/python/cpython / test_instance

Method test_instance

Lib/test/test_reprlib.py:751–761  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

749 self.assertEqual(repr(bar.bar), "<class '%s.bar'>" % bar.__name__)
750
751 def test_instance(self):
752 self._check_path_limitations('baz')
753 write_file(os.path.join(self.subpkgname, 'baz.py'), ''&#x27;\
754class baz:
755 pass
756''&#x27;)
757 importlib.invalidate_caches()
758 from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import baz
759 ibaz = baz.baz()
760 self.assertStartsWith(repr(ibaz),
761 "<%s.baz object at 0x" % baz.__name__)
762
763 def test_method(self):
764 self._check_path_limitations('qux')

Callers

nothing calls this directly

Calls 6

assertStartsWithMethod · 0.80
write_fileFunction · 0.70
joinMethod · 0.45
invalidate_cachesMethod · 0.45
bazMethod · 0.45

Tested by

no test coverage detected