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

Method test_invalid_shared_encoding

Lib/test/test__interpreters.py:504–513  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

502 _interpreters.set___main___attrs(self.id, None)
503
504 def test_invalid_shared_encoding(self):
505 # See https://github.com/python/cpython/issues/127196
506 bad_shared = {"\uD82A": 0}
507 msg = 'surrogates not allowed'
508 with self.assertRaisesRegex(UnicodeEncodeError, msg):
509 _interpreters.exec(self.id, 'a', shared=bad_shared)
510 with self.assertRaisesRegex(UnicodeEncodeError, msg):
511 _interpreters.run_string(self.id, 'a', shared=bad_shared)
512 with self.assertRaisesRegex(UnicodeEncodeError, msg):
513 _interpreters.run_func(self.id, lambda: None, shared=bad_shared)
514
515
516class RunStringTests(TestBase):

Callers

nothing calls this directly

Calls 2

assertRaisesRegexMethod · 0.80
execMethod · 0.80

Tested by

no test coverage detected