Closed Mayur5712 closed 12 months ago
Closing as user error, random objects in tests ids Are not supported, please explicitly name them using pytest.param
For anyone getting the same, if you are using something dynamic like this:
@pytest.mark.parametrize(
"test_time,test_scenario",
[
(datetime.now(), MyEnum.MY_VALUE_1),
(datetime.now() - relativedelta(years=17), MyEnum.MY_VALUE_1),
],
)
Change it to this:
@pytest.mark.parametrize(
"test_time,test_scenario",
[
pytest.param(datetime.now(), MyEnum.MY_VALUE_1, id="name_of_my_test_1"),
pytest.param(datetime.now() - relativedelta(years=17), MyEnum.MY_VALUE_1, id="name_of_my_test_2"),
],
)
I am trying to execute my tests parallel using xdist library, but after 10-15 tests library got crashed and execution stops.
Below is the error I got