From c4a705a78e200f27e4feeebd558ebc3f62578f30 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Thu, 22 Dec 2022 14:38:24 -0500 Subject: [PATCH 1/3] test opencv functionality separately --- .github/workflows/ci.yml | 3 +++ jwst/jump/tests/test_jump_step.py | 5 +++-- setup.cfg | 1 - tox.ini | 8 +++++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c01d7d5a92..172043844b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/jwst/jump/tests/test_jump_step.py b/jwst/jump/tests/test_jump_step.py index c2bafaa283..e3baf43bbc 100644 --- a/jwst/jump/tests/test_jump_step.py +++ b/jwst/jump/tests/test_jump_step.py @@ -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 @@ -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 diff --git a/setup.cfg b/setup.cfg index 521177780b..33d74ef7db 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/tox.ini b/tox.ini index b657294977..873721af4f 100644 --- a/tox.ini +++ b/tox.ini @@ -80,18 +80,20 @@ commands = regtests: --bigdata --slow --basetemp={homedir}/test_outputs \ xdist: -n auto \ pyargs: {toxinidir}/docs --pyargs jwst \ - {posargs} + {posargs} \ + opencv: -- jwst/jump/tests/test_jump_step.py 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 = From 1bbded831d380883721ba5ec438dc9692b433d3c Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Thu, 22 Dec 2022 14:44:13 -0500 Subject: [PATCH 2/3] fix line continuation --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 873721af4f..2ec4e98eb8 100644 --- a/tox.ini +++ b/tox.ini @@ -80,8 +80,8 @@ commands = regtests: --bigdata --slow --basetemp={homedir}/test_outputs \ xdist: -n auto \ pyargs: {toxinidir}/docs --pyargs jwst \ - {posargs} \ - opencv: -- jwst/jump/tests/test_jump_step.py + opencv: -- jwst/jump/tests/test_jump_step.py \ + {posargs} deps = xdist: pytest-xdist devdeps: -rrequirements-dev.txt From 15f1baf5a63701b8051b2165d734ddde8b5632a8 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Thu, 22 Dec 2022 14:46:36 -0500 Subject: [PATCH 3/3] add toxenv description --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 2ec4e98eb8..97c064bf50 100644 --- a/tox.ini +++ b/tox.ini @@ -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