Skip to content

Restore ValueError expectation in test_generator_ccds_without_unit - #961

Merged
mwcraig merged 1 commit into
astropy:mainfrom
mwcraig:revert-925-ccds-test
Jul 26, 2026
Merged

Restore ValueError expectation in test_generator_ccds_without_unit#961
mwcraig merged 1 commit into
astropy:mainfrom
mwcraig:revert-925-ccds-test

Conversation

@mwcraig

@mwcraig mwcraig commented Jul 26, 2026

Copy link
Copy Markdown
Member

Follow-up to a Copilot review comment on #925 (merged), which pointed out that test_generator_ccds_without_unit now carries both the backend_xfail("jax") marker (added in cf4f4b7) and an explicit jax branch asserting that ccds() returns a CCDData for unit-less files.

Those two contradict each other. The marker's reason documents that the jax behavior is platform-dependent: on Linux CI ccds() fails to raise ValueError, while on macOS with identical astropy/jax versions it does raise. The jax branch added in #925 asserts the Linux behavior unconditionally, so on macOS it fails and is silently absorbed by the marker as an xfail; on Linux it passes and is reported as a (non-strict) xpass. Net effect: the test can never fail on jax on any platform, and on macOS it asserts the wrong thing.

This PR reverts the test body to expect ValueError on all backends and keeps the backend_xfail marker. Raising for unit-less files is the intended behavior; the unexplained Linux-only jax deviation stays visible as an xfail rather than being encoded as correct. (Copilot suggested removing the marker instead, but that would break macOS jax runs given the platform dependence.)

Verified locally: test_image_collection.py passes under numpy and dask; under jax on macOS the reverted test xpasses (non-strict), and on Linux CI it should xfail as it did before #925.

Checklist

  • Did you add an entry to the CHANGES.rst file? (Not needed — test-only change with no user-facing behavior.)
  • Did you add a regression test? (Test-only change.)

🤖 Generated with Claude Code

https://claude.ai/code/session_01463EbSeiTmBJevbvpMNRm8

PR astropy#925 changed this test to assert that on the jax backend ccds()
returns a CCDData for unit-less files instead of raising ValueError.
That encodes a Linux-only bug symptom as expected behavior: on macOS
with identical astropy/jax versions, ccds() does raise ValueError, so
the jax branch of the test fails there and is silently absorbed by the
backend_xfail marker added in cf4f4b7 for the same symptom. With both
in place the test can never fail on jax on any platform.

Revert the test body to expect ValueError on all backends and keep the
backend_xfail marker, which documents the unresolved platform-dependent
jax behavior. Raising for unit-less files is the intended behavior;
the Linux jax deviation stays visible as an xfail instead of being
asserted as correct.

Follows up on a Copilot review comment on astropy#925.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01463EbSeiTmBJevbvpMNRm8
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.63%. Comparing base (8064a74) to head (b932212).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #961   +/-   ##
=======================================
  Coverage   96.63%   96.63%           
=======================================
  Files           8        8           
  Lines        1574     1574           
=======================================
  Hits         1521     1521           
  Misses         53       53           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mwcraig
mwcraig merged commit d75b365 into astropy:main Jul 26, 2026
18 checks passed
@mwcraig
mwcraig deleted the revert-925-ccds-test branch July 26, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant