We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b284a90 commit 7ae6bb2Copy full SHA for 7ae6bb2
tests/test_pytypes.py
@@ -111,12 +111,14 @@ def __repr__(self):
111
assert s1 == s2
112
113
malformed_utf8 = b"\x80"
114
- with pytest.raises(UnicodeDecodeError) as excinfo:
115
- assert m.str_from_object(malformed_utf8)
116
- assert 'invalid start byte' in str(excinfo.value)
117
118
- assert m.str_from_handle(malformed_utf8)
119
+ if env.PY2:
+ with pytest.raises(UnicodeDecodeError):
+ assert m.str_from_object(malformed_utf8)
+ assert m.str_from_handle(malformed_utf8)
+ else:
120
+ assert m.str_from_object(malformed_utf8) == "b'\\x80'"
121
+ assert m.str_from_handle(malformed_utf8) == "b'\\x80'"
122
123
124
def test_bytes(doc):
0 commit comments