This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: regression with ./python -m test and pdb
Type: Stage: resolved
Components: Tests Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: matrixise, miss-islington, pablogsal, steve.dower, vstinner
Priority: normal Keywords: patch

Created on 2018-10-09 14:19 by matrixise, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 10204 merged pablogsal, 2018-10-28 22:56
PR 10227 merged miss-islington, 2018-10-29 20:46
PR 10228 merged miss-islington, 2018-10-29 20:46
Messages (10)
msg327405 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2018-10-09 14:19
Hi Steve,

I have a regression since the commit d0f49d2f5085ca68e3dc8725f1fb1c9674bfb5ed,

commit d0f49d2f5085ca68e3dc8725f1fb1c9674bfb5ed (HEAD)
Author: Steve Dower <steve.dower@microsoft.com>
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.
msg328827 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2018-10-29 13:39
Pablo,

I have tested your PR and I get the prompt of pdb only if I use -v on the command line.

For the print() function, I understand but for the pdb.set_trace() function, normally we should have the prompt even we don't specify the --verbose flat.

Do you confirm?
msg328863 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-10-29 20:09
New changeset 02277482ea765335e497ecd9661d4bde9b5ddc67 by Pablo Galindo in branch 'master':
bpo-34945: Buffer output in test suite only when creating junit file (GH-10204)
https://github.com/python/cpython/commit/02277482ea765335e497ecd9661d4bde9b5ddc67
msg328864 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-10-29 20:10
This should be fixed (it works now with and without -v). :)
msg328870 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-10-29 20:44
At least Python 3.6 and 3.7 branches are affected as well, so I reopen the issue.
msg328873 - (view) Author: miss-islington (miss-islington) Date: 2018-10-29 21:05
New changeset 58f7bf3a892031616a6b06ef4b8d36e2ebec172b by Miss Islington (bot) in branch '3.7':
bpo-34945: Buffer output in test suite only when creating junit file (GH-10204)
https://github.com/python/cpython/commit/58f7bf3a892031616a6b06ef4b8d36e2ebec172b
msg328874 - (view) Author: miss-islington (miss-islington) Date: 2018-10-29 21:07
New changeset 7b689c68ab3236455f7d58954435d029e2bb2c8a by Miss Islington (bot) in branch '3.6':
bpo-34945: Buffer output in test suite only when creating junit file (GH-10204)
https://github.com/python/cpython/commit/7b689c68ab3236455f7d58954435d029e2bb2c8a
msg328875 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2018-10-29 21:09
3.6 and 3.7 are backported!
History
Date User Action Args
2022-04-11 14:59:06adminsetgithub: 79126
2018-10-29 21:09:33pablogsalsetstatus: open -> closed

messages: + msg328875
stage: patch review -> resolved
2018-10-29 21:07:54miss-islingtonsetmessages: + msg328874
2018-10-29 21:05:38miss-islingtonsetnosy: + miss-islington
messages: + msg328873
2018-10-29 20:46:48miss-islingtonsetpull_requests: + pull_request9542
2018-10-29 20:46:39miss-islingtonsetstage: resolved -> patch review
pull_requests: + pull_request9541
2018-10-29 20:44:58vstinnersetstatus: closed -> open

messages: + msg328870
versions: + Python 3.6, Python 3.7
2018-10-29 20:10:11pablogsalsetstatus: open -> closed

messages: + msg328864
stage: patch review -> resolved
2018-10-29 20:09:43pablogsalsetnosy: + pablogsal
messages: + msg328863
2018-10-29 13:39:56matrixisesetmessages: + msg328827
2018-10-28 22:56:11pablogsalsetkeywords: + patch
stage: patch review
pull_requests: + pull_request9522
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