Skip to content

Instantly share code, notes, and snippets.

@davidlatwe
Forked from mattbennett/.coveragerc
Created September 9, 2018 07:31
Show Gist options
  • Save davidlatwe/d19dcf2bf7c52eb2028d8ecad6424229 to your computer and use it in GitHub Desktop.
Save davidlatwe/d19dcf2bf7c52eb2028d8ecad6424229 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