Repository navigation
fix(dev): add pytest-env so EXR tests pass locally without exporting env vars - #247
Merged
nikopueringer merged 1 commit intoMay 1, 2026
Conversation
`pyproject.toml` already declares the env var that any EXR-touching test
needs, but it lives under `[tool.pytest.ini_options].env`, which is a
key provided by the third-party `pytest-env` plugin. The plugin was not
in the dev dependency group, so a fresh `uv sync --group dev` install
shipped without it. Locally pytest emitted
PytestConfigWarning: Unknown config option: env
…and `tests/test_clip_manager.py::TestVideoMaMa::test_videomama_exr_gamma_handling`
failed with `OpenEXR codec is disabled`. CI didn't catch it because
`.github/workflows/ci.yml:12` exports the env var on the runner, masking
the missing plugin.
Adding `pytest-env` makes the local pytest run match the CI behaviour
without anyone having to remember to export `OPENCV_IO_ENABLE_OPENEXR`.
Verified by uninstalling the env var locally, running pytest, and watching
the previously-failing test go green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
Closes #242.
pyproject.tomlalready declares:…but the
envkey is provided by the third-partypytest-envplugin, and that plugin is not in[dependency-groups].dev. After a freshuv sync --group dev, pytest emits…and the env var is never set.
tests/test_clip_manager.py::TestVideoMaMa::test_videomama_exr_gamma_handlingthen fails with:CI passes because
.github/workflows/ci.yml:12exportsOPENCV_IO_ENABLE_OPENEXR=1on the runner — that masked the gap. Anyone runningpytestlocally without that env var trips it.The change
One line in
pyproject.tomlplus the resultinguv.lockregeneration:I also added a short comment above the line explaining why the plugin is required so the next maintainer doesn't trim it as a "redundant" dep.
How I verified
On main, with no env var exported:
→ fails with the OpenEXR error.
On this branch, after
uv pip install pytest-envinto my dev venv, with no env var:→ passes. Plugin list now shows
env-1.6.0.Why this is its own PR (not bundled with #241)
#241 (CorridorKeyBlue feature) intentionally avoided modifying dev tooling. This is dev-environment infrastructure with zero behavioural impact on the runtime — easier to review and revert independently if needed.
Test plan
uv sync --group devinstallspytest-envcleanly (verified via lock diff).