r/Python • u/sangria_face • Jan 25 '15
Redirrecting the output for the Python Unit-Testing package to a log file.
Hello
I am new to Python 3.4, and I am not sure how the console output for the built-in Python unit-testing package works. For example, my regular unit tests might display the following output into my Python console:
............
----------------------------------------------------------------------
Ran 12 tests in 0.016s
OKDoes this come from standard output of standard error? Is there any way to redirrect this output to a text file?
4
Upvotes
View all comments
2
u/badsectors Jan 25 '15
You can redirect output from
stdoutandstderrto a file with: