Unit test coverage for cf.py - #7259
Conversation
There was a problem hiding this comment.
@ESadek-MO FYI in case you wanted to know
There should be a
conftest.pyfile in theroot/unitandroot/integrationfolders. Additional lower levelconftests can be added if it is agreed there is a need.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7259 +/- ##
==========================================
+ Coverage 90.42% 90.68% +0.25%
==========================================
Files 93 93
Lines 25816 25816
Branches 4796 4796
==========================================
+ Hits 23344 23411 +67
+ Misses 1693 1650 -43
+ Partials 779 755 -24 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Templating
This PR includes changes that may be worth sharing via templating. For each file listed below, please either:
- Action the suggestion via a pull request editing/adding the relevant file in the SciTools/.github
templates/directory. 1 - Raise an issue against the SciTools/.github repo for the above action if you really don't have 10mins spare right now. Include an assignee, to avoid it being forgotten.
- Dismiss the suggestion if the changes are not suitable for templating.
You will need to dismiss this review before this PR can be merged. Recommend the reviewer does this as their final action before merging, as this text will continually update as commits come in.
Template candidates
The following changed files are not currently templated, but their parent directories suggest they may be good candidates for a new template to be created:
Footnotes
-
Include this text in the PR body to avoid any notifications about applying the template changes back to the source repo!
@scitools-templating: please no update notification on: iris↩
| assert "temp" in cf_group.data_variables | ||
|
|
||
|
|
||
| class Test_translate__formula_terms_derived_bounds: |
There was a problem hiding this comment.
NOTE: I have not yet had time to validate this test class (formula terms are hard!).
There was a problem hiding this comment.
Done: a9d1ccc
I understand why the tests are written this way, and confirmed they provide 100% coverage.
BUT: I'm sorry to say that this area of the code is so difficult to understand that I've been unable to form a good model of what good 'conceptual coverage' should look like. I.e. the cases we would want to cover regardless of the chosen Iris implementation. I can pursue this further at the reviewer's request, but I can't judge myself whether it is worth it.
Description
Ref #6977
Still lots left to do; pushing up as an advanced preview.
Disclosure: heavy use of Copilot for this one, but I have carefully reviewed the full output and made modifications where needed.
To-do
2026-08-27CFGroupcoverageCFReadercoverageCFVariablecoverageWhen I refer to full unit coverage I am talking about a dedicated test module delivering said coverage - instead of relying on incidental coverage that is accidentally provided by other unit tests.
Checklist
Important
The Iris core developers are here to help! If anything below is unclear, just post a comment asking for help 😊
(further reading)
Tip
Things you can trigger on this PR:
9999for this PR's number - to re-trigger the CLA check:https://cla-assistant.io/check/SciTools/iris?pullRequest=9999