Skip to content

Commit f5d5fa4

Browse files
committed
test: Fix coverage reporting
By adding the current working directory to the `sys.path`.
1 parent 7dbc6e4 commit f5d5fa4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ jobs:
3434
pip install .
3535
- name: Run tests
3636
run: |
37-
py.test -vv --cov=injector --cov-branch --cov-report html --cov-report term
37+
# Run via `python -m pytest` (not `py.test`) so the working directory is on
38+
# sys.path and coverage measures the local `injector/` rather than the copy
39+
# installed in site-packages. Otherwise coverage reports 0%.
40+
# See https://github.com/pytest-dev/pytest-cov/issues/98
41+
python -m pytest -vv --cov=injector --cov-branch --cov-report html --cov-report term
3842
if which mypy; then mypy injector ; fi
3943
if which black; then black --check . ; fi
4044
check-manifest

0 commit comments

Comments
 (0)