def test_show_code(stream_fixture): dis.show_code(TEST_SOURCE_CODE, file=stream_fixture) actual = stream_fixture.getvalue() assert actual == EXPECTED_CODE_INFO + '\n'
def test_show_code(self): self.maxDiff = 1000 for x, expected in self.test_pairs: with captured_stdout() as output: dis.show_code(x) self.assertRegex(output.getvalue(), expected+"\n")
def test_show_code(self): self.maxDiff = 1000 for x, expected in self.test_pairs: with captured_stdout() as output: dis.show_code(x) self.assertRegex(output.getvalue(), expected + "\n")