Skip to content

Commit

Permalink
Fix tox configuration to validate code coverage correctly
Browse files Browse the repository at this point in the history
fixes aiiie#8
  • Loading branch information
Nicoretti committed Jan 26, 2022
1 parent b821ff8 commit b3224bd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion prysk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def main():
try:
sys.exit(prysk.main(sys.argv[1:]))
except (BrokenPipeError, KeyboardInterrupt):
except (BrokenPipeError, KeyboardInterrupt): # pragma: nocover
pass


Expand Down
5 changes: 2 additions & 3 deletions tests/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ if [ -n "$COVERAGE" ]; then
fi

alias prysk="`which "$COVERAGE"` run -a --rcfile=$TESTDIR/../.coveragerc \
$TESTDIR/../scripts/prysk --shell=$TESTSHELL"
$TESTDIR/../prysk --shell=$TESTSHELL"
alias doctest="`which "$COVERAGE"` run -a --rcfile=$TESTDIR/../.coveragerc \
$TESTDIR/run-doctests.py"
alias md5="`which "$COVERAGE"` run -a --rcfile=$TESTDIR/../.coveragerc \
$TESTDIR/../scripts/md5.py"
alias md5="$PYTHON $TESTDIR/../scripts/md5.py"
else
PYTHON="`command -v "$PYTHON" || echo "$PYTHON"`"
alias prysk="$PYTHON -m prysk --shell=$TESTSHELL"
Expand Down
14 changes: 11 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
#TODO: adjust set of used python interpreter(s)
envlist=py3-{integration}-{dash,bash,zsh},py3-{coverage}
envlist=integration-{dash,bash,zsh},coverage

[testenv]
setenv =
Expand All @@ -12,11 +12,19 @@ setenv =
deps =
-r{toxinidir}/requirements.txt

[testenv:integration-{dash,bash,zsh}]
commands =
integration: prysk {env:TESTOPTS:--shell=dash} {toxinidir}/tests
prysk {env:TESTOPTS:--shell=bash} {toxinidir}/tests

[testenv:coverage]
setenv =
COVERAGE = coverage
COVERAGE_FILE={toxinidir}/.coverage

commands =
coverage report --fail-under=100
coverage run -a --rcfile={toxinidir}/.coveragerc -m prysk.cli {env:TESTOPTS:--shell=bash} {toxinidir}/tests
coverage run -a --rcfile={toxinidir}/.coveragerc -m prysk.cli {env:TESTOPTS:--shell=dash} {toxinidir}/tests
coverage run -a --rcfile={toxinidir}/.coveragerc -m prysk.cli {env:TESTOPTS:--shell=zsh} {toxinidir}/tests
coverage report --fail-under=100


0 comments on commit b3224bd

Please sign in to comment.