Skip to content

Commit

Permalink
update test coverage script
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffckerr committed Aug 14, 2023
1 parent 4260521 commit 1c53f9a
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tests/check_coverage
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
#!/bin/bash
# Run all tests and check coverage

export SCIRIS_BACKEND='agg' # Don't open up figures

# To use pytest-xdist (more robust), use -n auto; to use pytest-parallel (faster), use --workers=auto
method=${1:-robust}
if [ $method == "fast" ]; then
parallel='--workers=auto'
else
parallel=' -n auto'
fi

echo 'Running tests...'
pytest -v test_*.py --cov-config=.coveragerc --cov=../sciris --durations=0 $parallel
pytest -v test_*.py -n auto --cov-config=.coveragerc --cov=../sciris --durations=0

echo 'Creating HTML report...'
coverage html

echo 'Running report...'
echo 'Printing report...'
coverage report

echo 'Report location:'
Expand Down

0 comments on commit 1c53f9a

Please sign in to comment.