Title: regression with ./python -m test and pdb
Type: Stage:
Components: Tests Versions: Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: matrixise, steve.dower, vstinner
Priority: normal Keywords:

Created on 2018-10-09 14:19 by matrixise, last changed 2018-10-13 16:15 by steve.dower.

Messages (3)
msg327405 - (view) Author: Stéphane Wirtel (matrixise) * (Python triager) Date: 2018-10-09 14:19
Hi Steve,

I have a regression since the commit d0f49d2f5085ca68e3dc8725f1fb1c9674bfb5ed,

commit d0f49d2f5085ca68e3dc8725f1fb1c9674bfb5ed (HEAD)
Author: Steve Dower <>
Date:   Tue Sep 18 09:10:26 2018 -0700

    bpo-34582: Adds JUnit XML output for regression tests (GH-9210)

Before, I could use pdb for the debugging or just use the print() function for debugging.

Now, this is just impossible, because stdout & stderr are mapped to an other destination.

For the test, just add `import pdb; pdb.set_trace()` in a test and try to execute it.

Thank you
msg327462 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-10-10 08:51
More generally, previously it was possible to add print("HERE") in tests. I use that often do debug tests. Now, the output is hidden, I don't understand the rationale for hiding the output.
msg327658 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2018-10-13 16:15
Thanks for spotting this!

There's no "rationale" for hiding the output - what happened is I streamlined the test suite to always capture output, instead of some tests deciding whether they ought to capture it or not (and some doing incredibly weird things when capturing, and others capturing the capture).

While I was testing I went immediately to `print(file=sys.__stderr__)`, since that's what I normally do, but it shouldn't be too hard to make the test suite only capture output when collecting it for the test results.

I'll try and get to it in the next two weeks, depending on how my conference schedules work out. I'm also happy to review someone else's change.
Date User Action Args
2018-10-13 16:15:45steve.dowersetmessages: + msg327658
2018-10-10 08:51:06vstinnersetnosy: + vstinner
messages: + msg327462
2018-10-09 14:20:25matrixisesettitle: regression with ./python -m test -> regression with ./python -m test and pdb
2018-10-09 14:19:39matrixisecreate