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

Method test_unicode_errors_no_object

Lib/test/test_exceptions.py:1346–1350  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1344 self.assertEqual(str(u), "can't translate characters in position 1000-4: 965230951443685724997")
1345
1346 def test_unicode_errors_no_object(self):
1347 # See issue #21134.
1348 klasses = UnicodeEncodeError, UnicodeDecodeError, UnicodeTranslateError
1349 for klass in klasses:
1350 self.assertEqual(str(klass.__new__(klass)), "")
1351
1352 def test_unicode_error_str_does_not_crash(self):
1353 # Test that str(UnicodeError(...)) does not crash.

Callers

nothing calls this directly

Calls 3

strFunction · 0.85
assertEqualMethod · 0.45
__new__Method · 0.45

Tested by

no test coverage detected