Closed drewwells closed 9 years ago
Hi @drewwells. The problem lies with this line:
var NoColor = !isatty.IsTerminal(os.Stdout.Fd())
Somehow this get's set to false when go test ./...
is called. If you call just go test
it's still true. Another interesting thing is that go test -v ./...
also works.
So I'm not quite sure why the stdout
changes between go test ./...
and go test -v ./...
. I don't have the time for debugging, but you can easily fix it by adding the -v
flag :)
oh nice, -v
is a good workaround. I think that is intended behavior, I have noticed stdout doesn't get populated when recursively executing tests. If each test manually assigned a fd to os.Stdout, would that pass the isTerminal check?
@drewwells I've just set it explicit to false. Tests should always be the same, so depending on the environment is something which should imho be changed. Now even go test ./...
works as intended.
Ah okay, since NoColor is exported I should be able to add those to my tests too. Thanks!
I ran into this while upgrading some tests to check for colorized output. Tests worked fine in the package, but
go test ./...
fails. You can reproduce this easily in this repo.tests pass
go test
tests fail
go test ./...