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

Method test_error

Lib/test/test_compileall.py:512–523  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

510 shutil.rmtree(self.directory)
511
512 def test_error(self):
513 buffer = io.TextIOWrapper(io.BytesIO(), encoding='ascii')
514 with contextlib.redirect_stdout(buffer):
515 compiled = compileall.compile_dir(self.directory)
516 self.assertFalse(compiled) # should not be successful
517 buffer.seek(0)
518 res = buffer.read()
519 self.assertIn(
520 'SyntaxError: bytes can only contain ASCII literal characters',
521 res,
522 )
523 self.assertNotIn('UnicodeEncodeError', res)
524
525
526class CommandLineTestsBase:

Callers

nothing calls this directly

Calls 6

seekMethod · 0.95
readMethod · 0.95
assertFalseMethod · 0.80
assertInMethod · 0.80
assertNotInMethod · 0.80
compile_dirMethod · 0.45

Tested by

no test coverage detected