Opened 11 years ago

Closed 11 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: no UI/UX: no


When using the command
python 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 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 test --settings=settings
and in the settings file
TEST_RUNNER_OUTPUT_STREAM=testoutput.txt or something.

Change History (2)

comment:1 Changed 11 years ago by (none)

milestone: post-1.0

Milestone post-1.0 deleted

comment:2 Changed 11 years ago by Jacob

Resolution: wontfix
Status: newclosed

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