Issue 22431: Change format of test runner output (original) (raw)

Created on 2014-09-17 13:44 by googol, last changed 2022-04-11 14:58 by admin.

Pull Requests
URL Status Linked Edit
PR 21609 open ZackerySpytz,2020-07-24 23:58
Messages (10)
msg227000 - (view) Author: Philipp Metzler (googol) Date: 2014-09-17 13:44
Can I change the test runner output format to main.tests.tests.TimeSlotTestCase.test_creation ... ERROR instead of test_creation (main.tests.tests.TimeSlotTestCase) ... ERROR so that I can easily just copy&paste that line and run the test again without having to remove the brackets () and having to copy the name of the test behind the class and add a .?
msg227001 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-09-17 13:58
I remember this feature being requested before (I vote +1 myself :), and I believe I recall a conversation involving Michael Foord where he approved it in principle, but I can't find an open issue for it. As a new feature it can only go into 3.5, and would presumably need to be controlled by an option somewhere to preserve backward compatibility with things that parse unittest output. If you want to work on a patch that would be welcome.
msg230801 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2014-11-07 12:34
I don't consider the console output of unittest to be a stable interface. Michael - do you? Things that want to process unittest should be using the API.
msg230802 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-11-07 12:39
I agree with Robert. However, since software authors' wishes can clearly be diverse here, perhaps there should be a simple way for them to customize the output?
msg230957 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2014-11-10 11:59
I agree with Robert that the text output of the default runner should not be considered a part of the "api" that we make backwards compatible guarantees about. People who want to customise that should be customising the text runner/result. (Unfortunately it requires tinkering with both at the moment.)
msg231100 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2014-11-13 10:21
Yes, making customising the output easier is a good thing. One way is to use e.g. subunit.run (which can work with all unittest versions since 2.6) and write a custom filter. Or a custom TestResult and TextTestRunner can work too :)
msg277081 - (view) Author: Tim Graham (Tim.Graham) * Date: 2016-09-21 00:20
Is there opposition to changing the default output as outlined in the first comment? If so, then I think this ticket should be closed or retitled to reflect the intent.
msg277082 - (view) Author: Tim Graham (Tim.Graham) * Date: 2016-09-21 00:23
Here's the patch if we make the change in Django instead: https://github.com/cjerdonek/django/commit/9c8d162f3f616e9d9768659a06fcf27bb389214b
msg277083 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-09-21 00:43
My understanding of the comments is that the change to the default is OK (in a feature release, at least).
msg277084 - (view) Author: Robert Collins (rbcollins) * (Python committer) Date: 2016-09-21 01:03
+1 to changing the UI for 3.7 - just noting that if you're machine processing the output, the TUI isn't an appropriate channel.
History
Date User Action Args
2022-04-11 14:58:08 admin set github: 66621
2020-07-24 23:58:19 ZackerySpytz set keywords: + patchnosy: + ZackerySpytzpull_requests: + <pull%5Frequest20751>stage: patch review
2016-10-19 22:04:28 jdufresne set nosy: + jdufresne
2016-09-21 01:03:31 rbcollins set messages: +
2016-09-21 00:43:03 r.david.murray set messages: + versions: + Python 3.7, - Python 3.5
2016-09-21 00:23:15 Tim.Graham set messages: +
2016-09-21 00:20:24 Tim.Graham set nosy: + Tim.Grahammessages: +
2014-11-13 10:21:29 rbcollins set messages: +
2014-11-10 11:59:20 michael.foord set messages: +
2014-11-07 12:39:33 pitrou set nosy: + pitroumessages: +
2014-11-07 12:34:34 rbcollins set nosy: + rbcollinsmessages: +
2014-09-17 23:08:48 martin.panter set nosy: + martin.panter
2014-09-17 13:58:04 r.david.murray set versions: + Python 3.5, - Python 2.7nosy: + r.david.murray, michael.foordmessages: + components: + Library (Lib), - Tests
2014-09-17 13:44:38 googol create