Open tschm opened 3 months ago
Hi @tschm and thanks for trying pytest-copie!
Your use case is quite different from the design idea I had in mind.
To me, every time I'm calling back the constructor means that I'm trying a new configuration thus I want to start from scratch. For running multiple test on the resulting build, I usually run the template test suit like in this repository: https://github.com/12rambau/pypackage/blob/main/tests/test_build.py
What would happen with a session scope constructor if anything goes wrong in one of your tests ? file corruption, deletion of folder, pre-commit modifications etc ....
The tmp_path fixture has scope "function". Hence your copie fixture will always have the same scope which makes it less useful than it could be.
I have worked first on a fixture for creating a temp_path (for dst) that has a larger scope, e.g
and then doing the expensive construction of the template only once for all tests...
I am now exposing the built template and can run various tests against it.
What do you think? Please share your thoughts.