-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Possible regression of pdb suppressing output #3052
Comments
GitMate.io thinks the contributor most likely able to help you is @nicoddemus. |
I started debugging this, and I don't yet know why the behavior broke, but I know why the test still passes. The test expects to find the text "getrekt" in the output:
It indeed exists, just not as a result of the print statement, rather in the traceback of the assertion failure:
A possible solution is to update the print in the test to the following:
... and the regex to the following:
Now the test does indeed fail, but passes if I add |
I found the problem, but from the looks of the code it appears to be intentional. The reports, including the captured call stdout, are explicitly not printed when pdb has been shown. Lines 534 to 539 in 0899727
I looked over your original PR, and it doesn't look like the correct way to do what you wanted. I'm guessing it happened to work at the time but subsequent changes (understandably) broke it. |
Hey @brianmaissy thanks for looking into this, glad to know I'm not going crazy! Curious, any idea why they are forcibly removed? Is there a flag which will enable them to be outputted? In the event of pdb being triggered, it's surely important to be able to see the context of why it's been triggered, even if it's an optional flag? |
I would be inclined to agree, but I'm very new to the code, hopefully someone who knows the history of this issue can give some insight into the rationale. @nicoddemus, @RonnyPfannschmidt ? |
Hey guys sorry for the delay, this got lost in my TODO list.
When Lines 54 to 58 in 3bc7ced
Lines 65 to 79 in 3bc7ced
I'm not entirely sure how this all work together and I have to leave for now, but perhaps someone can test if changing |
In the test in question, we are entering through The output is indeed getting captured, and not thrown away. The problem is that it is saved in the test report (in If I comment out the But in this case it does seem relevant to print the output before entering the debugger. The question is how do we get at the output which was already saved into the test report? Maybe adding the lines:
on line 89 of debugging.py, in |
@brianmaissy I didn't take a good look at the code, but your suggestion seems reasonable. |
Hey guys, /cc @nicoddemus
Approx two years ago I submitted a patch for
--pdb
to stop suppressing output, seen here;#1223
I can see the PR was merged and the appropriate test is present in master;
pytest/testing/test_pdb.py
Line 150 in 5c6d773
But when trying to use this myself, it doesn't seem to work, as seen below.
Any thoughts why this would pass unit tests, but wouldn't work in latest release?
The text was updated successfully, but these errors were encountered: