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

Breakpoint in hypothesis test is not hit #837

Closed
tekumara opened this issue Feb 6, 2022 · 8 comments
Closed

Breakpoint in hypothesis test is not hit #837

tekumara opened this issue Feb 6, 2022 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@tekumara
Copy link

tekumara commented Feb 6, 2022

In VS Code a breakpoint on the assert line will not be hit, eg:

from statistics import mean

from hypothesis import given
from hypothesis import strategies as st


@given(st.lists(st.floats(allow_nan=False, allow_infinity=False), min_size=1))
def test_mean(xs):
    print("test_mean")
    assert min(xs) <= mean(xs) <= max(xs)

Hypothesis: 6.26.1
Vscode: 1.64.0 (commit 5554b12acf27056905806867f251c859323ff7e9)
Debugpy: 1.5.1
Python: 3.9.7
Pytest: 6.2.5
OS: Darwin x64 21.3.0

See tekumara/hypothesis-debug-vscode for a full reproduction.

@tekumara
Copy link
Author

tekumara commented Feb 6, 2022

If export PYDEVD_USE_FRAME_EVAL=1 is set the breakpoint will be hit.

If a breakpoint() line is added, it will be hit.

@gramster
Copy link
Member

gramster commented Feb 14, 2022

I could not get your repro code to work, but do you have the right settings in VS Code?

@tekumara
Copy link
Author

I'm using "justMyCode": false and

Screen Shot 2022-02-15 at 4 02 49 pm

@karthiknadig
Copy link
Member

@tekumara Can you share your launch.json?

@tekumara
Copy link
Author

This is it here: launch.json

@karthiknadig
Copy link
Member

karthiknadig commented Feb 15, 2022

@tekumara Thanks for the details, I am able to repro the bug. Looks like removing the given decorator it works as expected, but with the given decorator it does not.

/cc @fabioz
Potentially related: #709
related: #215

@fabioz
Copy link
Collaborator

fabioz commented Feb 18, 2022

I'm investigating.

As a note, when running under the debugger, programmatically using breakpoint() will stop at the proper place (but I still don't know why it's not working in the first place...)

@int19h int19h added bug Something isn't working and removed waiting for response labels Feb 22, 2022
fabioz added a commit to fabioz/debugpy that referenced this issue Feb 24, 2022
fabioz added a commit to fabioz/debugpy that referenced this issue Feb 24, 2022
fabioz added a commit to fabioz/debugpy that referenced this issue Feb 24, 2022
@fabioz fabioz closed this as completed in 6134532 Feb 25, 2022
@fabioz
Copy link
Collaborator

fabioz commented Feb 25, 2022

I've just pushed a fix for this in the debugger.

The issue was the same seen in #844 but in a different context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants