Closed
Description
This looks like it has just crept into pytest 2.8.1.
I have a parametrised test where I'm passing in unicode, decoded from bytes. Pytest fails to even collect the test. This didn't used to happen (env's with 2.7.2 are running fine) and I'm pretty sure the code is legitimate across Python 2/3
class TestASCII:
def test_valid(self, ascii):
ascii.value = b'some text'
assert ascii.value == b'some text'
value = b'\xc3\xbc'.decode("utf-8")
@pytest.mark.parametrize("value",
[
value,
10,
[]
]
)
def test_invalid(self, ascii, value):
with pytest.raises(TypeError):
ascii.value = value