removed test_image_cursor_formatting() #30465
Open
+0
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Test not working as intended
The test
test_image.test_image_cursor_formatting()
is intended to test mouseover formatting of masked image data.see issue #15103 and resolution in PR #15140 .
However, this test does not work as intended, because it
Artist.format_cursor_data()
will in normal circumstances call_ColorizerInterface._format_cursor_data_override()
:However, because of the way
test_image_cursor_formatting()
is implemented the array sent toim.format_cursor_data()
is 1d, and_format_cursor_data_override()
is therefore not called.i.e. this test does not test the formatting of masked image data as intended.
The relevant behavior has another test
The relevant test (
test_image.test_image_cursor_formatting()
) is 6 years old. Since then, a more comprehensive test forim.format_cursor_data()
has been developed, reproduced below.This tests
im.format_cursor_data()
with masked values (nan), and I therefore believe it is not necessary to adapttest_image.test_image_cursor_formatting()
so that it tests the relevant behavior, andim.format_cursor_data()
can instead be removed.Why did this attract my attention
I noticed this because I am adapting
_format_cursor_data_override()
to work with multivariate data, see #29876 and related PRs, and need to develop new tests for this behavior. I attempted to base my tests ontest_image.test_image_cursor_formatting()
but this proved futile, and I will instead implement tests based ontest_image.test_format_cursor_data()
.