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

Method check_constant

Lib/test/test_compile.py:771–777  ·  view source on GitHub ↗
(self, func, expected)

Source from the content-addressed store, hash-verified

769 self.assertEqual(namespace['x'], 12)
770
771 def check_constant(self, func, expected):
772 for const in func.__code__.co_consts:
773 if repr(const) == repr(expected):
774 break
775 else:
776 self.fail("unable to find constant %r in %r"
777 % (expected, func.__code__.co_consts))
778
779 # Merging equal constants is not a strict requirement for the Python
780 # semantics, it's a more an implementation detail.

Callers 4

check_same_constantMethod · 0.95
test_merge_constantsMethod · 0.95

Calls 1

failMethod · 0.45

Tested by

no test coverage detected