Skip to content
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

Gaclac reader tests fail when pygac is installed and is run with other tests #1568

Open
mraspaud opened this issue Feb 25, 2021 · 0 comments

Comments

@mraspaud
Copy link
Member

I have no clue why, but with this PR, these import statements all return in mocks, causing a test failure:

def test_init(self):
"""Test GACLACFile initialization."""
from pygac.gac_klm import GACKLMReader
from pygac.gac_pod import GACPODReader
from pygac.lac_klm import LACKLMReader
from pygac.lac_pod import LACPODReader

Any clue why that would happen with my PR, which is just doing stuff with warning filters and loggers?

These failures happen on my local machine if and only if local pygac is installed, and I run the new tests:

pytest test_utils.py reader_tests/test_avhrr_l1b_gaclac.py (or a generic pytest) while pygac is installed gives me:

================================================================================================================== short test summary info ===================================================================================================================
FAILED reader_tests/test_avhrr_l1b_gaclac.py::TestGACLACFile::test__slice - ValueError: Given start line 5 exceeds scanline range 2                                                                                                                          
FAILED reader_tests/test_avhrr_l1b_gaclac.py::TestGACLACFile::test_init - AssertionError: <class 'pygac.gac_pod.GACPODReader'> is not <MagicMock name='mock.gac_pod.GACPODReader' id='140567597024208'> : Wrong reader class assigned to NSS.GHRR.NA.D79184...
FAILED reader_tests/test_avhrr_l1b_gaclac.py::TestGACLACFile::test_strip_invalid_lat - TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''  
========================================================================================================= 3 failed, 21 passed, 41 warnings in 6.24s ==========================================================================================================

pytest reader_test/test_avhrr_l1b_gaclac.py — all tests pass.

Originally posted by @gerritholl in #1554 (comment)

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

No branches or pull requests

1 participant