Skip to content

Commit 674204f

Browse files
committed
test: more flexibility in setting a static context locally
1 parent 61f6ee5 commit 674204f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: igor.py

+2
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ def run_tests_with_coverage(tracer, *runner_args):
163163
os.environ['COVERAGE_HOME'] = os.getcwd()
164164
context = os.environ.get('COVERAGE_CONTEXT')
165165
if context:
166+
if context[0] == "$":
167+
context = os.environ[context[1:]]
166168
os.environ['COVERAGE_CONTEXT'] = context + "." + tracer
167169

168170
# Create the .pth file that will let us measure coverage in sub-processes.

Diff for: metacov.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ source =
1616
${COVERAGE_HOME-.}/tests
1717
# $set_env.py: COVERAGE_DYNCTX - Set to 'test_function' for who-tests-what
1818
dynamic_context = ${COVERAGE_DYNCTX-none}
19-
# $set_env.py: COVERAGE_CONTEXT - Set to a static context for this run
19+
# $set_env.py: COVERAGE_CONTEXT - Static context for this run (or $ENV_VAR like $TOX_ENV_NAME)
2020
context = ${COVERAGE_CONTEXT-none}
2121

2222
[report]

0 commit comments

Comments
 (0)