testomatio / pytestomatio

Pytest plugin to analyze tests and link them automatically with Testomat.io test case management system
MIT License
8 stars 4 forks source link

Internal error on bytes data inside pytest params #3

Closed tiho44 closed 11 months ago

tiho44 commented 11 months ago

We use some encrypted data as pytest.param which causes INTERNALERROR> TypeError: Object of type bytes is not JSON serializable

looks like it's handling all data types quite well, and just needs some decoding.

thank you

Ypurek commented 11 months ago

could you please provide a little bit more context? Mb steps, commands? I'll have a look on this issue on the weekend

tiho44 commented 11 months ago

here's simple example:

@pytest.mark.parametrize('param', [b"Hello"])
def test_bytes_param(param):
    assert "Hello" == param.decode("utf-8")

cmd is sync

thanks a lot!

Ypurek commented 11 months ago

issue fixed

tiho44 commented 10 months ago

thanks a lot for quick fix, work nice