Opened 2 years ago

Closed 2 years ago

Last modified 8 days ago

#23332 closed Cleanup/optimization (wontfix)

Change format of test runner output

Reported by: Philipp Metzler Owned by: nobody
Component: Testing framework Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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 .?

Change History (4)

comment:1 Changed 2 years ago by Carl Meyer

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: wontfix
Status: newclosed

Django uses the built-in unittest library of Python, and the test output is entirely handled by unittest. So there is nothing in Django which could be changed to modify this output. The feature request seems reasonable to me, but it would need to be pursued as a change in the Python standard library.

comment:2 Changed 2 years ago by Areski Belaid

I think you could achieve this by hacking the https://docs.python.org/2/library/unittest.html#unittest.TestResult
Here an example of testrunner adding color: https://github.com/stevematney/redgreenunittests

My guess would be to use the same hack around TestResult to change the output format.

comment:3 Changed 2 years ago by Philipp Metzler

created an issue here: http://bugs.python.org/issue22431

comment:4 Changed 8 days ago by Tim Graham

Following duplicate ticket #27255, a django-developers thread proposes to reopen this issue.

Note: See TracTickets for help on using tickets.
Back to Top