Skip to content

Commit fcda786

Browse files
committed
Identify dependence of coverage on order of test imports
1 parent c8f8a4e commit fcda786

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ jobs:
100100
ls .venv/lib/python3.11/site-packages/example_fgen_basic
101101
- name: Run tests
102102
run: |
103-
# uv run --no-sync pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml
104-
uv run --no-editable --reinstall-package example-fgen-basic python -c 'import example_fgen_basic;print(example_fgen_basic.__file__)'
105-
cd .venv/lib/python3.11/site-packages/example_fgen_basic
106-
ls
107-
../../../../bin/python -c 'import exceptions; print("Found exceptions here")'
108-
../../../../bin/python -c 'import _lib; print("Found _lib here")'
109-
cd ../../../../../
110-
ls
111-
.venv/bin/pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml
112-
uv run which pytest
113-
uv run --no-editable --reinstall-package example-fgen-basic pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml
103+
uv run --no-sync pytest -r a -v tests src --doctest-modules --doctest-report ndiff --cov=src --cov-report=term-missing --cov-report=xml
104+
# uv run --no-editable --reinstall-package example-fgen-basic python -c 'import example_fgen_basic;print(example_fgen_basic.__file__)'
105+
# cd .venv/lib/python3.11/site-packages/example_fgen_basic
106+
# ls
107+
# ../../../../bin/python -c 'import exceptions; print("Found exceptions here")'
108+
# ../../../../bin/python -c 'import _lib; print("Found _lib here")'
109+
# cd ../../../../../
110+
# ls
111+
# .venv/bin/pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml
112+
# uv run which pytest
113+
# uv run --no-editable --reinstall-package example-fgen-basic pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml
114114
uv run --no-sync coverage report
115115
- name: Upload coverage reports to Codecov with GitHub Action
116116
uses: codecov/codecov-action@v4.2.0

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ruff-fixes: ## fix the code using ruff
4040

4141
.PHONY: test
4242
test: ## run the tests (re-installs the package every time so you might want to run by hand if you're certain that step isn't needed)
43-
uv run --no-editable --reinstall-package example-fgen-basic pytest tests src tests -r a -v --doctest-modules --doctest-report ndiff --cov=src
43+
uv run --no-editable --reinstall-package example-fgen-basic pytest -r a -v -tests src -doctest-modules --doctest-report ndiff --cov=src
4444

4545
# Note on code coverage and testing:
4646
# You must specify cov=src.

0 commit comments

Comments
 (0)