Skip to content

Commit

Permalink
test: more flexibility in setting a static context locally
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 24, 2023
1 parent 61f6ee5 commit 674204f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions igor.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ def run_tests_with_coverage(tracer, *runner_args):
os.environ['COVERAGE_HOME'] = os.getcwd()
context = os.environ.get('COVERAGE_CONTEXT')
if context:
if context[0] == "$":
context = os.environ[context[1:]]
os.environ['COVERAGE_CONTEXT'] = context + "." + tracer

# Create the .pth file that will let us measure coverage in sub-processes.
Expand Down
2 changes: 1 addition & 1 deletion metacov.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source =
${COVERAGE_HOME-.}/tests
# $set_env.py: COVERAGE_DYNCTX - Set to 'test_function' for who-tests-what
dynamic_context = ${COVERAGE_DYNCTX-none}
# $set_env.py: COVERAGE_CONTEXT - Set to a static context for this run
# $set_env.py: COVERAGE_CONTEXT - Static context for this run (or $ENV_VAR like $TOX_ENV_NAME)
context = ${COVERAGE_CONTEXT-none}

[report]
Expand Down

0 comments on commit 674204f

Please sign in to comment.