colorama
colorama copied to clipboard
tests are failing on macos/iterm/zsh with AssertionError: stdout should not be wrapped
I tried to run tox on colorama on MacOS with iTerm and zsh and I got multiple failures looking like:
Full log at https://gist.github.com/ssbarnea/30127add6646aaca448be876c7b51edd
There are two aspects regarding this:
- why it fails (apparently colorama works well)
- how to assure that the CI (Travis) would test this so we can avoid passing CI in cases like this?
Hmm. The tests have to be run with -s
in order to work (the README specifies this, but says it's only relevant for nosetests
). Adding -s
to tox.ini fixes this problem. I wonder how we missed this. Thanks for reporting this.
I think I'll move tox
to use the same command we use in the Makefile
and in .travis.yaml
. This will disable the coverage option, though.
Even with -s
, tests fail if stdout isn't a TTY (easily reproduced, for instance with pytest -s | cat
). Is there a workaround?
EDIT: found one: script -eqc "pytest -s" /dev/null
works as expected and can be piped to anything.