MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_instance

Method test_instance

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

write_fileFunction · 0.85
reprFunction · 0.85
joinMethod · 0.45
invalidate_cachesMethod · 0.45
bazMethod · 0.45
assertStartsWithMethod · 0.45

Tested by

no test coverage detected