Skip to content

Instantly share code, notes, and snippets.

@omaciel
Forked from mattbennett/.coveragerc
Created December 5, 2017 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omaciel/d55769a123478820ec6fe7111d2ff6c0 to your computer and use it in GitHub Desktop.
Save omaciel/d55769a123478820ec6fe7111d2ff6c0 to your computer and use it in GitHub Desktop.
coverage subprocess
[run]
branch = True
source = .
def foo():
return "foo"
def bar():
return "bar"
import coverage
coverage.process_startup()
from impl import foo, bar
def test_foo():
assert foo() == "foo"
def test_bar():
assert bar() == "bar"
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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment