Skip to content

Commit

Permalink
Fix running pytest with coverage
Browse files Browse the repository at this point in the history
Pytest and coverage would get confused for an unknown reason presumably
related to installed packages vs. packages in the current directory. Not
installing bloscpack and running pytest with PYTHONPATH=. fixes this
issue.
  • Loading branch information
esc committed Mar 11, 2021
1 parent ae79b6d commit d17d93b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/testbloscpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:
run: |
pip install -r requirements.txt
pip install -r test_requirements.txt
- name: Install from source
run: pip install .
- name: Run tests
run: ./test.sh
- name: Report coverage
Expand Down
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ echo "Testing command line interface with cram"
COVERAGE=1 cram --verbose $@ test_cmdline/*.cram
cram_exit=$?
echo "Executing unit tests with pytest"
pytest --cov=bloscpack test
PYTHONPATH=. pytest --cov=bloscpack test
pytest_exit=$?
if [ $cram_exit -gt 0 ] || [ $pytest_exit -gt 0 ] ; then
echo "some tests failed"
Expand Down

0 comments on commit d17d93b

Please sign in to comment.