Opened 7 years ago

Closed 6 years ago

#9028 closed (wontfix)

Testing, allow test output to redirected to a different output stream or multiple output streams

Reported by: man_nick_utd Owned by: nobody
Component: Testing framework Version: 1.0
Severity: Keywords: Redirect test output
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When using the command
python manage.py test
In my circumstance i would like to redirect the test output to a file, but in other instances redirecting to the stout and a file would be useful.
For unittest.TextTestRunner you can specify the stream to use in the constructor, if this option could be added to a command line option for the above command.
The reason i don't just use
python manage.py test > testoutput.txt
is because if the database has already been created and you want to recreate the database the option to recreate the database will not be displayed on the screen it will be piped to the file.
At the moment i have written my own testrunner to implement this option but having used JUnit and CPPUnit before and knowing this is a feature available to both of them (CPPUnit easier then JUnit) i thought this would be a cool option to add to Django.
A possible solution would be to add an option to the settings file
python manage.py test --settings=settings
and in the settings file
TEST_RUNNER_OUTPUT_STREAM=testoutput.txt or something.


Change History (2)

comment:1 Changed 6 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:2 Changed 6 years ago by jacob

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

I don't see the point in cluttering the settings namespace with stuff like this; shell redirection exists for a reason.

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