Skip to content
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

fixed missing coverage for one-line lambdas in 3.11 #60

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xirafa
Copy link

@xirafa xirafa commented Dec 12, 2024

For issue #59 :

One-line lambdas are missing coverage probes (3.11).

If a lambda is not executed, we don't get any indication.
This is due to interplay between dis.findlinestarts() which removes duplicated, and slipcover.findlinestarts() which ignores noop-like opcode of RESUME and RETURN_GENERATOR.

@jaltmayerpizzorno
Copy link
Collaborator

Thank you for your contribution! Any chance you'd be willing to add a test that replicates the issue?

@xirafa
Copy link
Author

xirafa commented Dec 12, 2024

I added a simple test but apparently the current coverage report does report unexecuted lambdas as actually executed (probably due to covering the entire statement which defines the lambda).

Delving into this requires a bit more time than I have now - but probably someone might want to examine this further.

See the updated PR with the new test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants