Closed smarie closed 3 years ago
For the last part (a__param
) unfortunately the fact that this is a tuple containing the two parameters is something that actually reflects the underlying pytest behaviour: since fixtures can only have a single parameter, pytest-cases is making it user-friendly but it does not change the fact that there is a single parameter.
For test_bar_c_param
I guess that what is printed is the string representation of the fixture union alternative but the object is available so the following should work:
module_results_df['test_bar_c_param_id'] = module_results_df['test_bar_c_param'].apply(lambda o: o.get_alternative_id())
It correctly yields the new result:
test_id test_bar[a-b=1-c=2] test_bar[a-b=4-c=2]
pytest_obj <function test_bar at 0x0000025023023AE8> <function test_bar at 0x0000025023023AE8>
status passed passed
duration_ms 0.4035 0.3943
test_bar_c_param c/P0F/a c/P0F/a
a__param (1, 2) (4, 2)
test_bar_c_param_id a a
yields