-
Notifications
You must be signed in to change notification settings - Fork 18
Update numerical file comparisons in tests #231
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #231 +/- ##
=======================================
Coverage 99.07% 99.08%
=======================================
Files 21 21
Lines 1084 1087 +3
=======================================
+ Hits 1074 1077 +3
Misses 10 10
🚀 New features to boost your workflow:
|
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.
looks good. Couple of small comments
tests/test_morphio.py
Outdated
@@ -50,6 +50,20 @@ def isfloat(s): | |||
return False | |||
|
|||
|
|||
def compare_numeric(file1, file2): |
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.
this should probably have a name like are_same(file1, file2)
since it returns True if they are the same and False if they are not. Something like that.
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.
Changed to are_files_same
tests/test_morphio.py
Outdated
@@ -149,7 +163,7 @@ def test_morph_outputs(self, setup, tmp_path): | |||
with open(test_saving_verbose.joinpath(file)) as tf: | |||
generated = filter(ignore_path, gf) | |||
target = filter(ignore_path, tf) | |||
assert all(x == y for x, y in zip(generated, target)) | |||
compare_numeric(generated, target) |
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.
can we call the options expected
and actual
to make the test more intelligible
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.
Resolved
Create a shared function for numerical file comparisons.