MNT: refactor tests to use cfradial1_sgp_dtree session fixture#347
Open
aladinor wants to merge 1 commit intoopenradar:mainfrom
Open
MNT: refactor tests to use cfradial1_sgp_dtree session fixture#347aladinor wants to merge 1 commit intoopenradar:mainfrom
aladinor wants to merge 1 commit intoopenradar:mainfrom
Conversation
Add cfradial1_sgp_dtree session fixture to conftest.py and refactor 8 tests across test_util.py and test_accessors.py to use it instead of inlining DATASETS.fetch + open_cfradial1_datatree. Closes openradar#346
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #347 +/- ##
=======================================
Coverage 93.61% 93.61%
=======================================
Files 27 27
Lines 5797 5797
=======================================
Hits 5427 5427
Misses 370 370
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kmuehlbauer
reviewed
Mar 30, 2026
Collaborator
kmuehlbauer
left a comment
There was a problem hiding this comment.
@aladinor Thanks! One suggestion here.
| import xradar as xd | ||
|
|
||
| filename = DATASETS.fetch("sample_sgp_data.nc") | ||
| return xd.io.open_cfradial1_datatree(filename) |
Collaborator
There was a problem hiding this comment.
Would it make sense to just return the filename and open inside the test function? This would prevent from possible changes of the DataTree object during tests (as the .copy() in the tests below suggest).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
cfradial1_sgp_dtreesession fixture toconftest.pytest_util.py(6) andtest_accessors.py(2) to use the shared fixture instead of inliningDATASETS.fetch("sample_sgp_data.nc")+open_cfradial1_datatree()Closes #346
Test plan
test_util.py+test_accessors.pypass🤖 Generated with Claude Code