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.
Fixes two bugs found by tester.
Missing input file produces traceback
Handle this more elegantly.
Write to output file doesn't work
Trying to write a string to a file handle opened in bytes mode.
Testing/Refactor
The first commit is a refactor without functional changes to allow for testing, and tests for the issues described. Checking f812619 out should cause two of the three tests (
pytest metomi/rose/tests/test_env_cat.py -vv
) to fail.The second commit 1abaca8 fixes both problems.
Additional check
By inserting print statements into the code I was able to ascertain that there coverage is now ~100%, though this is only a measure of quantity, not quality.
Tagged @oliver-sanders as a single Python test :. this is a smallish change with @dpmatthews as a functional tester.