PyCharm + Python + unittest + coverage: using setup.cfg for config file

I enjoy using PyCharm and am learning how to use it's coverage run configuration.

Per this article: Speed Up Coverage with Configuration File

I see one can configure coverage using .coveragerc.

My framework uses setup.cfg to house its configurations for a bunch of tools (including coverage).

Is there some way to have PyCharm's coverage run configuration use setup.cfg?

Versions

  • PyCharm PE 2020.1.4
  • Python 3.8.2
1
3 comments

I would add that this also applies to pyproject.toml files. For that one needs to

pip install coverage[toml]

does the embedded coverage support this?

0

setup.cfg is not supported by the built-in coverage functionality. As a workaround, you can create a separate run/debug configuration to call `python -m coverage run`.

 

Otherwise, Please feel free to submit a feature request to our issue tracker at https://youtrack.jetbrains.com/issues , and let us know if you require any help.

0

Please sign in to leave a comment.