Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include code that runs in runpytest_subprocess in coverage #7679

Closed
bluetech opened this issue Aug 24, 2020 · 2 comments
Closed

Include code that runs in runpytest_subprocess in coverage #7679

bluetech opened this issue Aug 24, 2020 · 2 comments
Labels
type: selftests a problem in the tests of pytest

Comments

@bluetech
Copy link
Member

bluetech commented Aug 24, 2020

In #7651 we had some code which is only covered by a subprocess test and is somewhat hard to cover inprocess.

It seems that the code running in the subprocess is not covered. @nicoddemus mentioned that some coverage configuration is needed to get this to work: https://coverage.readthedocs.io/en/stable/subprocess.html

@asottile
Copy link
Member

one way I've done this before is via coverage-enable-subprocess

essentially:

  1. install coverage-enable-subprocess under test
  2. https://github.com/asottile/setuptools-golang/blob/a6eaed0801255d4b2b7fb9e964126bce2747a0a9/tox.ini#L6
  3. https://github.com/asottile/setuptools-golang/blob/a6eaed0801255d4b2b7fb9e964126bce2747a0a9/.coveragerc#L5

@antonblr
Copy link
Member

Closing via #8188 - lines which have been shown as uncovered in #7651 are covered now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: selftests a problem in the tests of pytest
Projects
None yet
Development

No branches or pull requests

3 participants