-
-
Notifications
You must be signed in to change notification settings - Fork 436
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
Misleading branch coverage of empty methods #129
Comments
Turns out this isn't about abstract methods, it's about empty uncalled methods with only a docstring:
|
Original comment by Alex Gaynor (Bitbucket: alex_gaynor, GitHub: Unknown) It's unclear to me what the correct behavior is, it seems to me it's either a) no executed, or b) covered, but not a branch coverage thing. (b) is somewhat more convenient, but I'm not sure it's more correct. |
Original comment by Mike Nerone (Bitbucket: Manganeez, GitHub: Unknown) (a) would seem more appropriate for a bare function definition with only a docstring, while (b) seems right for an abstractmethod, so perhaps that should be special-cased as the OP suggested. Incidentally, it's easy enough to do per-project because the "blamed" lines are the ones with the decorators. In your project .coveragerc:
|
This will be fixed when the ast-branch code is merged. |
This is fixed in 44719bd (bb), which will be 4.1 |
Originally reported by Christian Heimes (Bitbucket: tiran, GitHub: tiran)
Branch coverage of an abc.abstractmethod with just a doc string in the method, shows the decorator line as uncovered branch that never reaches "exit".
When I replace the doc string with "pass", the decorator line is a covered branch. However the pass statement is not covered at all.
The text was updated successfully, but these errors were encountered: