Skip to content

Conversation

@mwcraig
Copy link
Member

@mwcraig mwcraig commented May 6, 2025

It turns out that there were a number of issues in the file that downstream packages would use to test API compatibility. This PR fixes them and marks one as xfail that tests colormaps.

mwcraig added 7 commits May 6, 2025 16:09
This was not actually testing passing in a file name...it was passing in
an HDU.
Which, admittedly, should have been the approach from the beginning.
It is not even clear colormaps are part of the API...
@mwcraig mwcraig requested a review from Copilot May 6, 2025 21:12
Copy link
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

This PR addresses issues in the API compatibility tests by fixing marker table return properties and error conditions while also marking the colormap test as xfail. Key changes include:

  • Renaming and updating marker table check functions and replacing direct attribute accesses with helper methods.
  • Modifying the FITS loading test to write and read from a temporary file.
  • Enhancing error matching in tests for offset operations, stretch, and cuts.
Comments suppressed due to low confidence (1)

src/astro_image_display_api/widget_api_test.py:52

  • [nitpick] Consider renaming '_check_empty_marker_table_return_properties' to a more concise name like '_assert_empty_marker_table' for clarity and brevity.
def _check_empty_marker_table_return_properties(self, table):

@mwcraig mwcraig requested a review from Copilot May 6, 2025 21:16
Copy link
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

This PR addresses API test issues by refactoring marker-related testing functions, refining exception match patterns, and marking the colormap test as xfail for downstream compatibility.

  • Renamed the marker table check method for clarity
  • Updated exception match patterns in several tests
  • Reworked file I/O in the FITS loading test and marked colormap tests as xfail
Comments suppressed due to low confidence (1)

src/astro_image_display_api/widget_api_test.py:110

  • Verify that the error message pattern 'are not convertible' matches the actual message from the underlying unit conversion logic, considering possible library updates.
with pytest.raises(u.UnitConversionError, match='are not convertible'):

@mwcraig mwcraig merged commit 534b8d4 into astropy:main May 6, 2025
1 check passed
@mwcraig mwcraig deleted the fix-api-test-issues branch May 6, 2025 21:18
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