I'm running pytest with pytest-cov with the following command line:
python -m pytest Mytools\tests --junitxml test_reports\unittest_result.xml --cov . --cov-branch --cov-report xml:test_reports\unittest_coverage.xml --cov-config=scripts\.coveragerc || exit /b 1
however I get this error:
CoverageWarning: Unrecognized option '[report] exclude_also=' in config file scripts\.coveragerc
My .coveragerc file looks like this:
[report]
exclude_also =
if __name__ == .__main__.:
Any idea on how to fix it? many thanks
Check your version of coverage.py:
exclude_alsowas introduced in version 7.2.0.