Skip to content

Commit e4c9ac0

Browse files
committed
Not checking UnicodeDecodeError message because it differs between CPython and PyPy.
Checking is too much trouble for very little gain. CPython: 'utf8' codec can't decode byte 0x80 in position 0: invalid start byte PyPy: 'utf8' codec can't decode byte 0x80 in position 0: invalid utf-8
1 parent d0acd55 commit e4c9ac0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/test_pytypes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,8 @@ def test_pybind11_str_raw_str():
262262

263263
malformed_utf8 = b'\x80'
264264
if pytest.PY2:
265-
with pytest.raises(UnicodeDecodeError) as excinfo:
265+
with pytest.raises(UnicodeDecodeError):
266266
cvt(malformed_utf8)
267-
assert "invalid start byte" in str(excinfo)
268267
else:
269268
malformed_cvt = cvt(malformed_utf8)
270269
assert type(malformed_cvt) is unicode if pytest.PY2 else str # noqa: F821
@@ -420,6 +419,5 @@ def test_pass_bytes_or_unicode_to_string_types():
420419
assert m.pass_to_std_string(u"Str") == 3
421420

422421
malformed_utf8 = b"\x80"
423-
with pytest.raises(UnicodeDecodeError) as excinfo:
422+
with pytest.raises(UnicodeDecodeError):
424423
m.pass_to_pybind11_str(malformed_utf8)
425-
assert 'invalid start byte' in str(excinfo.value)

0 commit comments

Comments
 (0)