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

Method test_opcode_caching

Lib/test/test_difflib.py:32–40  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

30 ('equal', 41, 81, 40, 80)])
31
32 def test_opcode_caching(self):
33 sm = difflib.SequenceMatcher(None, 'b' * 100, 'a' + 'b' * 100)
34 opcode = sm.get_opcodes()
35 self.assertEqual(opcode,
36 [ ('insert', 0, 0, 0, 1),
37 ('equal', 0, 100, 1, 101)])
38 # Implementation detail: opcodes are cached;
39 # `get_opcodes()` returns the same object
40 self.assertIs(opcode, sm.get_opcodes())
41
42 def test_bjunk(self):
43 sm = difflib.SequenceMatcher(isjunk=lambda x: x == ' ',

Callers

nothing calls this directly

Calls 3

get_opcodesMethod · 0.95
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected