Tests that importorskip('petab') skip when petab is installed but broken, so a broken petab passes CI as skipped tests
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 76/100
Research direction
Start by reading tests/conftest.py and the seven tutorial test modules updated for #1028, then locate the remaining pytest.importorskip('petab') calls across the 20 test files. Check that tests skip only when petab is absent and fail when an installed petab raises an import error; use the reproduction in the issue to verify the behavior.
Written by the indexing model from the issue text.
Description
153 calls of pytest.importorskip('petab') (or a petab. submodule) in 20 test files skip their tests when petab cannot be imported for any reason. pytest's importorskip turns a ModuleNotFoundError into a skip, and that includes one raised inside petab for a dependency that petab itself is missing. A petab that is installed but broken therefore does not fail any of these tests. They report as skipped, and some skip reasons name the wrong cause.
Reproduction. Put a stand-in petab on the path whose import fails on a missing dependency:
mkdir -p /tmp/fakepetab/petab
echo "import a_dependency_that_is_missing_xyz" > /tmp/fakepetab/petab/__init__.py
PYTHONPATH=/tmp/fakepetab .venv/bin/python -m pytest -o addopts='' -q -rs tests/test_linear_profiling.py tests/test_expression_objective.py
With the real petab 0.9.0 these two modules run 95 tests, all passing. With the broken one, both modules skip as a whole:
SKIPPED [1] tests/test_linear_profiling.py:39: could not import 'petab': No module named 'a_dependency_that_is_missing_xyz'
SKIPPED [1] tests/test_expression_objective.py:32: objective = expression needs the optional pybnf[petab] extra
The second reason says the extra is not installed. It is installed, and broken.
This matters most where petab breaks in an upgrade. petab has no pin beyond >=0.9,<1, and every CI leg except the dependency-floors one installs it, so a petab release that fails to import in PyBNF's environment would turn these suites into skips on every leg, with CI green.
#1028 added a petab marker that tests/conftest.py skips only when petab is absent (importlib.util.find_spec('petab') is None), and module-level skips in seven tutorial test modules that follow the same rule. A petab that is present but broken fails those tests. Converting the remaining importorskip('petab') calls to the marker, or to the same find_spec check, would give every petab test that behaviour.
- Dominant language
- Python
- Stars
- 25
- Forks
- 25
- Avg merge
- 4h 5m
- Merged PRs (30d)
- 10
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lanl/PyBNF
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug minor
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
bug minor
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug silent-incorrectness
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
software-mansion-labs/Diplomat#20 ·
Maintainers usually reply within 1 day
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPossibly taken @lijy91 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
libnativeapi/nativeapi#53 · 1 reaction ·
Maintainers usually reply within 1 day
-
View Counts discarded due to field name mismatchPossibly taken @rsiva0400 claimed this today. Opensite-bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Model version publishes the new UK firm entity as a personPossibly taken @vahid-ahmadi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PolicyEngine/policyengine.py#764 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
spcl/HPCAgent-Bench#264 ·
Maintainers usually reply within 1 day