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

Method testIntern

Lib/test/test_marshal.py:624–629  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

622 strobj = sys.intern(strobj)
623
624 def testIntern(self):
625 s = marshal.loads(marshal.dumps(self.strobj))
626 self.assertEqual(s, self.strobj)
627 self.assertEqual(id(s), id(self.strobj))
628 s2 = sys.intern(s)
629 self.assertEqual(id(s2), id(s))
630
631 def testNoIntern(self):
632 s = marshal.loads(marshal.dumps(self.strobj, 2))

Callers

nothing calls this directly

Calls 5

idFunction · 0.85
internMethod · 0.80
loadsMethod · 0.45
dumpsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected