Search code examples
pythonnosetests

how do i redirect the output of nosetests to a textfile?


I've tried "nosetests p1.py > text.txt" and it is not working.

What is the proper way to pipe this console output?


Solution

  • Try:

    nosetests -s p1.py > text.txt 2>&1
    

    Last --obvious--tip: If you are not in the test file directory, add before the .py file.