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

Method test_show_code

Lib/test/test_dis.py:1666–1674  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1664 self.assertRegex(dis.code_info(x), expected)
1665
1666 def test_show_code(self):
1667 self.maxDiff = 1000
1668 for x, expected in self.test_pairs:
1669 with captured_stdout() as output:
1670 dis.show_code(x)
1671 self.assertRegex(output.getvalue(), expected+"\n")
1672 output = io.StringIO()
1673 dis.show_code(x, file=output)
1674 self.assertRegex(output.getvalue(), expected)
1675
1676 def test_code_info_object(self):
1677 self.assertRaises(TypeError, dis.code_info, object())

Callers

nothing calls this directly

Calls 3

getvalueMethod · 0.95
captured_stdoutFunction · 0.90
assertRegexMethod · 0.80

Tested by

no test coverage detected