Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test opencv functionality separately #7414

Merged
merged 3 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ jobs:
- toxenv: test-oldestdeps-xdist-cov
os: ubuntu-latest
python-version: '3.8'
- toxenv: test-opencv-xdist
os: ubuntu-latest
python-version: '3.10'
steps:
- uses: actions/checkout@v3
with:
Expand Down
5 changes: 3 additions & 2 deletions jwst/jump/tests/test_jump_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ def test_three_group_integration(generate_miri_reffiles, setup_inputs):
override_readnoise=override_readnoise, maximum_cores='none')
assert out_model.meta.cal_step.jump == 'COMPLETE'

@pytest.mark.skipif(not OPENCV_INSTALLED, reason="`opencv-python` not installed")

@pytest.mark.xfail(not OPENCV_INSTALLED, reason="`opencv-python` not installed")
def test_snowball_flagging_nosat(generate_nircam_reffiles, setup_inputs):
"""Test that snowballs are properly flagged when the `sat_required_snowball`,
which requires there to be a saturated pixel within the cluster of
Expand Down Expand Up @@ -355,7 +356,7 @@ def test_snowball_flagging_nosat(generate_nircam_reffiles, setup_inputs):
assert (np.floor(expanded_area / initial_area) == (expand_factor**2))


@pytest.mark.skipif(not OPENCV_INSTALLED, reason="`opencv-python` not installed")
@pytest.mark.xfail(not OPENCV_INSTALLED, reason="`opencv-python` not installed")
def test_snowball_flagging_sat(generate_nircam_reffiles, setup_inputs):
"""Test that snowballs are properly flagged when the `sat_required_snowball`,
which requires there to be a saturated pixel within the cluster of
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ test =
colorama>=0.4.1
readchar>=3.0
ruff
opencv-python
pytest>=6.0.0
pytest-cov>=2.9.0
pytest-doctestplus>=0.10.0
Expand Down
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ commands =
[testenv]
description =
run tests
opencv: requiring opencv-python
devdeps: with the latest developer version of key dependencies
oldestdeps: with the oldest supported version of key dependencies
sdpdeps: with the recent STScI DMS release pinned dependencies
Expand Down Expand Up @@ -80,18 +81,20 @@ commands =
regtests: --bigdata --slow --basetemp={homedir}/test_outputs \
xdist: -n auto \
pyargs: {toxinidir}/docs --pyargs jwst \
opencv: -- jwst/jump/tests/test_jump_step.py \
{posargs}
deps =
xdist: pytest-xdist
devdeps: -rrequirements-dev.txt
sdpdeps: -rrequirements-sdp.txt
opencv: opencv-python
setenv =
sdpdeps,regtests: CRDS_CONTEXT = jwst-edit
commands_pre =
python -m pip install --upgrade pip
# Generate a requirements-min.txt file
# Generate a requirements-min.txt file
oldestdeps: minimum_deps
# Force install everything in that file
# Force install everything in that file
oldestdeps: pip install --ignore-installed -r requirements-min.txt
# Don't treat positional arguments passed to tox as file system paths
args_are_paths =
Expand Down