CleanCut / green

Green is a clean, colorful, fast python test runner.
MIT License
792 stars 75 forks source link

Don't print \r if we're not connected to a terminal. #53

Closed smspillaz closed 9 years ago

smspillaz commented 9 years ago

If stdout is connected to a pipe or file, this will result in duplicate lines.

Check to make sure we're connected to a terminal first before printing \r and other "status" like lines.

Fixes #52

coveralls commented 9 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling f10d166a49b2653c592fd1b3b4bf475c6df2f797 on smspillaz:fix-52 into d56a0c7811cf9f636401d8562324432e7b5be877 on CleanCut:master.

CleanCut commented 9 years ago

This seems like good logic for when we're auto-detecting whether or not to use color. What about the case when the user specifies -t/--termcolor to force colors on regardless of whether or not green is attached to a terminal?

CleanCut commented 9 years ago

Oh, wait. This doesn't disable colors. It disables the first line that gets rewritten once the test finishes. Sorry for being a bit slow on the uptake.

CleanCut commented 9 years ago

Included in 1.9.1 released just now.