Last active
March 4, 2020 05:59
-
-
Save mattbennett/0086536d500894448167 to your computer and use it in GitHub Desktop.
coverage subprocess
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[run] | |
branch = True | |
source = . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo(): | |
return "foo" | |
def bar(): | |
return "bar" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coverage | |
pytest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import coverage | |
coverage.process_startup() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from impl import foo, bar | |
def test_foo(): | |
assert foo() == "foo" | |
def test_bar(): | |
assert bar() == "bar" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import os | |
os.environ['COVERAGE_PROCESS_START'] = ".coveragerc" | |
def test_via_subproc(): | |
proc = subprocess.Popen(["py.test", "subproc_test.py", "-v"]) | |
proc.wait() |
Author
mattbennett
commented
Aug 19, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment