MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_file

Method test_file

Lib/test/test_symtable.py:583–598  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

581
582 @unittest.expectedFailure # TODO: RUSTPYTHON
583 def test_file(self):
584 filename = os_helper.TESTFN
585 self.addCleanup(os_helper.unlink, filename)
586 with open(filename, 'w') as f:
587 f.write(TEST_CODE)
588 with support.captured_stdout() as stdout:
589 symtable.main([filename])
590 out = stdout.getvalue()
591 self.assertIn('\n\n', out)
592 self.assertNotIn('\n\n\n', out)
593 lines = out.splitlines()
594 self.assertIn(f"symbol table for module from file {filename!r}:", lines)
595 self.assertIn(" local symbol 'glob': def_local", lines)
596 self.assertIn(" global_implicit symbol 'glob': use", lines)
597 self.assertIn(" local symbol 'spam': def_local", lines)
598 self.assertIn(" symbol table for function 'spam':", lines)
599
600 def test_stdin(self):
601 with support.captured_stdin() as stdin:

Callers

nothing calls this directly

Calls 8

addCleanupMethod · 0.80
assertInMethod · 0.80
assertNotInMethod · 0.80
openFunction · 0.50
writeMethod · 0.45
mainMethod · 0.45
getvalueMethod · 0.45
splitlinesMethod · 0.45

Tested by

no test coverage detected