Open nskmda opened 1 year ago
Oh, sorry, forgot to mention how I'm running the whole thing via Gradle Python plugin.
The command I'm executing is [supposedly] python -m pytest
which is run in the application
folder being the current working directory.
I am also facing the same issue.
Try adding this setting to your .coveragerc file (or other setting file): relative_files:
[run]
relative_files = true
Try adding this setting to your .coveragerc file (or other setting file): relative_files:
[run] relative_files = true
worked for me thanks
Team,
I'm trying to set up Python build in a project which is 'governed' by Gradle. I'm also trying to use Gradle/Maven-conventional source path for Python files (src/main/python, src/test/python).
In general, everything works fine and as expected with one caveat (for me, specifically). I'm using
pytest
withpytest.ini
where I setpytest-cov
configuration with the following:and corresponding
.coveragerc
:The problem I'm having is the path to the source files in the
python.xml
test coverage report. It seems to prefix thesrc/main/python
with the output of thepwd
command and I'm effectively getting stuff likewhere
/home/jenkins/workspace/pipeline-name-here/application/
is that annoying prefix I'm need to get rid of.My Gradle folder structure (w/service folders omitted) is like
Any suggestions?