-
-
Notifications
You must be signed in to change notification settings - Fork 414
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 context reporting for relative_files #902
fix context reporting for relative_files #902
Conversation
fix reporting of contexts when `relative_files = True` fixes nedbat#900
'covered_lines': 2, | ||
'num_statements': 3, | ||
'percent_covered': 66.66666666666667 | ||
for relative_files in [False, True]: |
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.
easier to look at this diff at https://github.com/nedbat/coveragepy/pull/902/files?w=1 (hiding whitespace changes)
i tried to use pytest parametrize but it doesn't work with unitttest tests
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.
In cases like this, i've used helper functions. I'll make that change. I really appreciate that you updated the tests, and thought about how best to update them. Thanks!
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.
Thank you!
@@ -1127,3 +1127,20 @@ def test_no_contexts_warns_no_contexts(self): | |||
self.start_import_stop(cov, "two_tests") | |||
with self.assert_warnings(cov, ["No contexts were measured"]): | |||
cov.html_report() | |||
|
|||
def test_dynamic_contexts_relative_files(self): | |||
self.make_file("two_tests.py", self.SOURCE) |
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 test was much smaller than the json one, so i duplicated it. do you have a preference of approach?
Codecov Report
@@ Coverage Diff @@
## master #902 +/- ##
==========================================
- Coverage 94.19% 94.16% -0.04%
==========================================
Files 86 86
Lines 11870 11887 +17
Branches 1185 1188 +3
==========================================
+ Hits 11181 11193 +12
- Misses 560 566 +6
+ Partials 129 128 -1
Continue to review full report at Codecov.
|
fix reporting of contexts when
relative_files = True
fixes #900