Skip to content

Support branch coverage for ternary expressions? #557

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

Closed
nedbat opened this issue Jan 23, 2017 · 4 comments
Closed

Support branch coverage for ternary expressions? #557

nedbat opened this issue Jan 23, 2017 · 4 comments
Labels
enhancement New feature or request

Comments

@nedbat
Copy link
Owner

nedbat commented Jan 23, 2017

Originally reported by Anonymous


Eg: a = 1 if b == c else 2 is not registering any missing branches.


@nedbat
Copy link
Owner Author

nedbat commented Jan 23, 2017

Original comment by Ionel Cristian Mărieș (Bitbucket: ionelmc, GitHub: ionelmc)


Ah dooh! I forgot to log in 😬

@nedbat
Copy link
Owner Author

nedbat commented Jan 23, 2017

Coverage works with the information from sys.settrace, which is line-based. It has no way to get information within a line.

Long ago, I experimented with a way to get intra-line information, but it is just a wild hack, not something that can be used for real yet: http://nedbatchelder.com/blog/200804/wicked_hack_python_bytecode_tracing.html

@nedbat
Copy link
Owner Author

nedbat commented Jan 23, 2017

This is another flavor of #292.

@nedbat
Copy link
Owner Author

nedbat commented Jan 23, 2017

Duplicate of #292.

@nedbat nedbat closed this as completed Jan 23, 2017
@nedbat nedbat added enhancement New feature or request and removed proposal labels Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant