Opened 12 months ago

Closed 12 months ago

Last modified 11 months ago

#23332 closed Cleanup/optimization (wontfix)

Change format of test runner output

Reported by: googol7 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 (3)

comment:1 Changed 12 months ago by carljm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

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 12 months ago by areski

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 11 months ago by googol7

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

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