Skip to content

Tidy NDCube tests#844

Merged
Cadair merged 13 commits into
sunpy:mainfrom
DanRyanIrish:tidy_tests
Jun 11, 2025
Merged

Tidy NDCube tests#844
Cadair merged 13 commits into
sunpy:mainfrom
DanRyanIrish:tidy_tests

Conversation

@DanRyanIrish
Copy link
Copy Markdown
Member

@DanRyanIrish DanRyanIrish commented May 27, 2025

PR Description

This PR breaks test_ndcube.py into multiple files based on the functionalities being tested, as the file was becoming unwieldy.

DO NOT merge until after #840

To Do

@DanRyanIrish DanRyanIrish marked this pull request as draft May 27, 2025 13:34
@DanRyanIrish DanRyanIrish added this to the 2.4.0 milestone May 27, 2025
@DanRyanIrish DanRyanIrish marked this pull request as ready for review May 30, 2025 16:18
@DanRyanIrish
Copy link
Copy Markdown
Member Author

@nabobalis or @Cadair: Any objection to splitting up the NDCube tests like this?

ndc + value


@pytest.mark.parametrize(("ndc", "value", "expected_kwargs"),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@PCJY Will you give this function and the multiply test below a quick review? Just take a look and ask questions about anything you don't understand. If you happen to find any problems, please point those out too.

In summary, I replaced all the __add__ tests (except test_arithmetic_add_one_unit) with this one, which is similar to your multiply test below. That's because the code and logic tree is much simpler than when you first wrote the tests.

I also added an extra case in the parameterizations of your multiply test to catch all the cases.

@nabobalis
Copy link
Copy Markdown
Member

I see no issue with splitting up test files to make it clear what each file is testing.

Comment thread changelog/844.bugfix.rst Outdated
@DanRyanIrish
Copy link
Copy Markdown
Member Author

@nabobalis Can you approve this?

@Cadair Cadair merged commit 19bdfdc into sunpy:main Jun 11, 2025
20 checks passed
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.

4 participants