I'm migrating all my modules to Poetry and I have a problem.
Before with a python setup.py test
I was able to run my tests with the correct coverage information.
Now I'm moving to poetry, so my best option is poetry run pytest
or otherwise poetry install; pytest
. In both cases, I have to specify the source location in Sonar to collect the coverage data. Here I would naturally just pass my src
folder, but clearly the references will be wrong because pytest is running using the code installed in the environment by poetry, not on the local code as it used to happen before, so the references will be mismatched. No amount of tinkering seems to be working.
So, is there a way with poetry to use the local references instead of the environment references when running with pytest? Or should I give up and use some weird trick with inspect
to retrieve the path of the installed package in the site-packages
folder?