Skip to content

Test skipping based on module (esp. healpix) availability#944

Open
sadielbartholomew wants to merge 10 commits into
NCAS-CMS:mainfrom
sadielbartholomew:test-skipping-post3.20
Open

Test skipping based on module (esp. healpix) availability#944
sadielbartholomew wants to merge 10 commits into
NCAS-CMS:mainfrom
sadielbartholomew:test-skipping-post3.20

Conversation

@sadielbartholomew
Copy link
Copy Markdown
Member

We have some test skipping for lack of required module availability, including cases where it is an 'optional' dependency not enforced by packaging requirements, but not comprehensive and not accounting for the new healpix optional dependency.

In the background to the EXPECT GA I've went in and added all skips required, replacing those on individual methods with module-level skipping for relevant test modules (regrid-related tests which all need esmpy including one case where there was a false positive i.e. test pass from lack of skip, and tests requiring an explicit or under-the-hood use of healpix).

@davidhassell a sanity check would be useful but feel free to approve if you don't think a review is necessary given this PR is only trivial test infra changes.

@sadielbartholomew sadielbartholomew self-assigned this Apr 15, 2026
@sadielbartholomew sadielbartholomew added the testing Issues related to units tests and their coverage label Apr 15, 2026
@sadielbartholomew
Copy link
Copy Markdown
Member Author

@davidhassell just a reminder as per our meeting today that it would be great to get this reviewed and merged when you have a change to look. Thanks.

Copy link
Copy Markdown
Collaborator

@davidhassell davidhassell left a comment

Choose a reason for hiding this comment

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

Hi Sadie,

I find that the setup variables are not available to the test methods ... is that what you get?

>>python test_HEALPix_utils.py 
Run date: 2026-05-30 12:00:00.673592
Platform: Linux-6.8.0-124-generic-x86_64-with-glibc2.39 

<snip>

test_HEALPix_pix2zuniq (__main__.DataTest.test_HEALPix_pix2zuniq)
Test _pix2zuniq ... ERROR
test_HEALPix_uniq2zuniq (__main__.DataTest.test_HEALPix_uniq2zuniq)
Test _uniq2zuniq ... ERROR
test_HEALPix_zuniq2pix (__main__.DataTest.test_HEALPix_zuniq2pix)
Test _zuniq2pix ... ERROR
test_HEALPix_zuniq2uniq (__main__.DataTest.test_HEALPix_zuniq2uniq)
Test _zuniq2uniq ... ERROR

======================================================================
ERROR: test_HEALPix_pix2zuniq (__main__.DataTest.test_HEALPix_pix2zuniq)
Test _pix2zuniq
----------------------------------------------------------------------
Traceback (most recent call last):
  File "cf-python/cf/test/test_HEALPix_utils.py", line 84, in test_HEALPix_pix2zuniq
    for r, i in zip(refinement_levels, nested_indices)
                    ^^^^^^^^^^^^^^^^^
NameError: name 'refinement_levels' is not defined

======================================================================
ERROR: test_HEALPix_uniq2zuniq (__main__.DataTest.test_HEALPix_uniq2zuniq)
Test _uniq2zuniq
----------------------------------------------------------------------
Traceback (most recent call last):
  File "cf-python/cf/test/test_HEALPix_utils.py", line 52, in test_HEALPix_uniq2zuniq
    np.array_equal(_uniq2zuniq(nuniq_indices), zuniq_indices)
                               ^^^^^^^^^^^^^
NameError: name 'nuniq_indices' is not defined

======================================================================
ERROR: test_HEALPix_zuniq2pix (__main__.DataTest.test_HEALPix_zuniq2pix)
Test _zuniq2pix
----------------------------------------------------------------------
Traceback (most recent call last):
  File "cf-python/cf/test/test_HEALPix_utils.py", line 68, in test_HEALPix_zuniq2pix
    order, i = _zuniq2pix(zuniq_indices, nest=True)
                          ^^^^^^^^^^^^^
NameError: name 'zuniq_indices' is not defined

======================================================================
ERROR: test_HEALPix_zuniq2uniq (__main__.DataTest.test_HEALPix_zuniq2uniq)
Test _zuniq2uniq
----------------------------------------------------------------------
Traceback (most recent call last):
  File "cf-python/cf/test/test_HEALPix_utils.py", line 60, in test_HEALPix_zuniq2uniq
    np.array_equal(_zuniq2uniq(zuniq_indices), nuniq_indices)
                               ^^^^^^^^^^^^^
NameError: name 'zuniq_indices' is not defined

----------------------------------------------------------------------
Ran 4 tests in 0.009s

FAILED (errors=4)
>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Issues related to units tests and their coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants