we could implement the pytest_sessionfinish hook with a "execute last" and if we are in a xdist worker, automatically persist all saved fixtures and report items - and if we are in the xdist master, automatically delete all saved fixtures and report items
in the get_synthesis_dct base method, if we are the xdist master, we should retrieve previously persisted data and use it instead of the saved fixtures and report items
The final user experience would be that they can use the get_session_results_df() method in the pytest_sessionfinish hook, without caring about persistence and sharing across workers
As per suggestion from @larsks in #34: current support for
pytest-xdist is still a bit complex: users have to follow the example [
conftest.py`](https://smarie.github.io/python-pytest-harvest/#pytest-x-dist).We could do several things to improve this :
we could implement the
pytest_sessionfinish
hook with a "execute last" and if we are in a xdist worker, automatically persist all saved fixtures and report items - and if we are in the xdist master, automatically delete all saved fixtures and report itemsin the
get_synthesis_dct
base method, if we are the xdist master, we should retrieve previously persisted data and use it instead of the saved fixtures and report itemsThe final user experience would be that they can use the
get_session_results_df()
method in thepytest_sessionfinish
hook, without caring about persistence and sharing across workers