smarie / python-pytest-harvest

Store data created during your `pytest` tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes.
https://smarie.github.io/python-pytest-harvest/
BSD 3-Clause "New" or "Revised" License
61 stars 8 forks source link

On pytest < 5.3, `lazy_value` parameters are wrongly inserted into `module_results_df` as integer instead of object #43

Closed smarie closed 3 years ago

smarie commented 3 years ago

With pytest<5.3 when collecting results from pytest cases, the parameters appear as "111111" in module_results_df instead of their actual case name.

Cause: unfortunately on pytest < 5.3, pytest-cases lazy_values inherit from int, so as to have their id correctly created by the pytest id maker engine from their __str__ method. See https://smarie.github.io/python-pytest-cases/pytest_goodies/#parametrize

Workaround:

smarie commented 3 years ago

Finally went for the last option, levaraging new pytest-cases 2.3.0