-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console default text and background colors are set to black #2510
Comments
I see the same (without tornado involved) since a while already, haven't tested recently yet. |
@jay-hennen if you have the time and can provide a small reproducible example, I can take a look. I've never experienced this myself or my colleagues (AFAIK) which are in majority also on Windows 10, so it is hard to figure out what might be the problem. |
For me, it's quite easy to reproduce Run
That's as far as I got with distilling the issue out. Unfortunately I don't know if this will cause the issue on your machines. It did not happen on my previous Windows 10 computer. Maybe the fact that it was an upgrade/migration from Win 7 while my current one is a 'fresh' install so to speak. |
Thanks. Hmm I actually see the problem in Python 3.6 but not in 2.7 on my Windows computer at work. Which Python are you using? |
I am using Python 2.7.13 and pytest v3.1.0. |
Heh lovely, I reproduce the problem in 3.6 but not on 2.7. 😋 I'll see if I can reproduce it from home. |
Hi all, I also tried to change my terminal's background color to white but generated the same problem. I also have a conftest.py but do not have Current workarounds on windows are either using windows subsystem for linux or by printing the outputs to a textfile using 'pytest file.py > file.txt' |
Thanks! Can you please post the contents of your conftest and test.py?
Em qui, 22 de jun de 2017 07:08, charlie-foxtrat <notifications@github.com>
escreveu:
… Hi all,
I currently reproduced the said issue in Python 3.6.1 running in venv and
pytest 3.1.2 using Windows 10. After running it, the terminal window
becomes totally black.
[image: pytest]
<https://user-images.githubusercontent.com/29189622/27426683-0c30f848-576f-11e7-8e1f-0599ff18b96a.png>
I also tried to change my terminal's background color to white but
generated the same problem.
[image: pytest bgrnd]
<https://user-images.githubusercontent.com/29189622/27426788-5abb004e-576f-11e7-8f7e-100fd968bff9.png>
I also have a conftest.py but do not have tornado.ioloop.
I can confirm that it is shell-independent since I was able to reproduce
the issue using git bash, cmd and powershell.
It works however when ran under windows subsystem for linux, and on ubuntu
machines.
Current workarounds on windows are either using windows subsystem for
linux or by printing the outputs to a textfile using 'pytest file.py >
file.txt'
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2510 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABCO_AbrqXpeDZY12mzQSHr9kftg7KfKks5sGj0agaJpZM4OAIUF>
.
|
conftest.py (the app that I have imported here is an instance of flask)
as for my test.py it was just a simple assertion test on my projects root folder beside the conftest.py. test.py
I tried removing my import of app and the terminal display worked properly again, so for my case I think the issue has something to do with flask. Edit: can confirm that flask is the problem for me,I tried importing flask directly and the issue remained
|
Thanks! Sorry about not being clear, I meant to ask for a reproducible example. 😁 But I managed to reproduce the problem (again in 3.6) just by importing |
@nicoddemus i suspect could be double init of colorama via click |
@RonnyPfannschmidt yeah, |
Here's a data point for you: tornado does not seem to have colorama as a dependency (maybe optional??)
Also, IIRC |
Just noticed that if you pause during a pytest run using something like pdb and then fix the console colors, they will break again after printing the success or failure message. Appears like this color change gets triggered sometime before the collected tests are run and then once more after they all finish. |
@jay-hennen |
Yep, definitely. I can reproduce with: # conftest.py
import colorama
# test_foo.py
def test():
pass If I move the |
So it's colorama then?? What a roundabout way for it to mess things up. Good job finding that! |
Fixed by #2611 |
Hi, this is a real head-scratcher. The only references I can find to something with similar symptoms are issue #459 and #399, but I think my situation is caused by something unrelated.
The symptoms are, when I run pytest in certain situations, the screen text and background are both set to black which causes 'invisible output' (see pic). This seems to be a shell-independent problem (as in it happens in git bash, powershell, and cmd.

I finally distilled this issue down to the following: Loading the
tornado.ioloop
module in a conftest.py file (even if buried at the bottom of an import stack) will cause the background and screen text to be set to black. In my case, something in our project importedzmq.eventloop.ioloop
which in turn importedtornado.ioloop
As far as I'm aware nobody else in the office has this problem, (and neither did I, until I got a new computer). For reference, I'm using Windows 10 Enterprise 64-bit v1607. Not sure where to go from here aside from digging into the conftest.py-handling code (or tornado.ioloop code)
Edit: I forgot to mention: I can edit the console properties and change the text back to the right color, which will cause all the 'invisible' text to reappear. However, this has to be done after each pytest run.
The text was updated successfully, but these errors were encountered: