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
Fix missing 'rb' mode for opening files #2077
Conversation
The failing CI error is
at https://github.com/pytroll/satpy/runs/5766689500?check_suite_focus=true#step:7:219 It appears unrelated to the PR unfortunately. |
@pdebuyl Thanks a lot for this! We are aware of the problem in the CI, so don't worry about these kinds of problems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! do you think you can add a test for this, to avoid possible regressions in the future?
I add a text test and a binary test, both plain and bzipped. |
@pdebuyl a fix for the failing ci is now available in the main branch. Merging main into your branch should solve these issues. |
Codecov Report
@@ Coverage Diff @@
## main #2077 +/- ##
=======================================
Coverage 93.85% 93.85%
=======================================
Files 283 283
Lines 42279 42307 +28
=======================================
+ Hits 39681 39709 +28
Misses 2598 2598
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
00d0634
to
fc5f776
Compare
Hi, I merged and force-pushed. The tests pass except for codebeat. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @pdebuyl for the fix! The relevant lines are still not covered, but currently I see no way to change this without adding even more mocks...
We really need to dynamically write a little test data file and use that for testing to get rid of all the |
Do you think of having actual HRIT files for testing? Else, you would only test the tests... One solution would be to have a "data" repository that could be used optionally when running the tests. |
I mean writing a small HRIT file during test setup. We already have the data type definitions for the header and image data, so maybe there's a way to write the header and a small image (like 10 scanlines or so) into a valid HRIT file. |
I like the idea of creating an HRIT file on the fly for testing :) |
I meant another repository. But indeed, generating small HRIT segments is also an option. Is there anything else regarding the current pull request? |
I think we're good, maybe @gerritholl wants to give it a spin before we merge? |
I ended up testing it myself, and it works fine. Merging |
Thanks, and sorry for putting a bug there! |
No problem, thanks for fixing it! |
Add a "mode" argument to the calls to
generic_open
. This was the case beforeusing this context manager and was dropped by mistake in 78ef550
This was not caught by tests as the tests are done with mocks instead of
data files.