unittest buffing output on windows?

R

Roy Smith

I'm running 2.5.1. I've got a test suite that takes about 15 minutes
to complete. On my unix boxes, as each test case executes, it prints
out a line (I'm using unittest.TextTestRunner(verbosity=2)) of status,
but on my windows box (running under cygwin), it buffers everything
until the entire test suite is completed.

I can stick sys.stdout.flush() and sys.stderr.flush() in my tearDown()
method, which gets me output, but that doesn't seem like the right
solution. Is there a better way to get the test runner to flush
output after every test case?
 
D

Dave Angel

Roy said:
I'm running 2.5.1. I've got a test suite that takes about 15 minutes
to complete. On my unix boxes, as each test case executes, it prints
out a line (I'm using unittest.TextTestRunner(verbosity=2)) of status,
but on my windows box (running under cygwin), it buffers everything
until the entire test suite is completed.

I can stick sys.stdout.flush() and sys.stderr.flush() in my tearDown()
method, which gets me output, but that doesn't seem like the right
solution. Is there a better way to get the test runner to flush
output after every test case?
You could try starting Python with the -u switch, which says don't
buffer stdout. or stderr (at least on Python 2.6). Try running
python -?

to see the commandline options. On the other hand, if it's specifically
a cygwin problem, I have no idea.

DaveA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top