Skip to content

Update stale VRT window clamping tests to match #1697 reject contract#1723

Closed
brendancol wants to merge 1 commit into
mainfrom
issue-1719
Closed

Update stale VRT window clamping tests to match #1697 reject contract#1723
brendancol wants to merge 1 commit into
mainfrom
issue-1719

Conversation

@brendancol
Copy link
Copy Markdown
Contributor

Summary

Test plan

  • pytest xrspatial/geotiff/tests/test_kwarg_behaviour_2026_05_12_v2.py (23 passed)
  • pytest xrspatial/geotiff/tests/ -k vrt (194 passed)
  • Searched the rest of xrspatial/geotiff/tests/ for clamping assertions; no other tests assert the old behaviour.

Closes #1719

After #1697, read_vrt rejects out-of-bounds windows with ValueError
instead of silently clamping. Two tests in
test_kwarg_behaviour_2026_05_12_v2.py still asserted the old clamping
behaviour and have been rewritten to lock in the reject contract,
mirroring the local-path (#1634) and HTTP path (#1669) validators.

Closes #1719
@github-actions github-actions Bot added the performance PR touches performance-sensitive code label May 12, 2026
@brendancol brendancol requested a review from Copilot May 12, 2026 19:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates stale VRT window-behavior tests to reflect the post-#1697 contract where read_vrt(..., window=...) rejects any out-of-bounds window with ValueError (instead of silently clamping).

Changes:

  • Renamed two window tests to reflect the new “reject” behavior.
  • Replaced clamping assertions with pytest.raises(ValueError, match="outside the VRT extent") for out-of-bounds windows (past-edge and negative offsets).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@brendancol
Copy link
Copy Markdown
Contributor Author

Superseded by #1731, which landed the same fix (different rename: test_window_outside_raster_bounds_rejected / test_window_negative_offsets_rejected rather than the names here). The conflict on rebase is exactly the duplicated test rewrite. Safe to close.

@brendancol brendancol closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

geotiff: VRT tests assert window clamping but read_vrt now rejects out-of-bounds windows

2 participants