Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix api test issues #15

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

Merged
merged 8 commits into from
May 6, 2025
Merged

Fix api test issues #15

merged 8 commits into from
May 6, 2025

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

@Copilot 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

@Copilot 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