Open marcodicro-dp opened 8 months ago
You might simply want to try running with the "Emulate terminal output" option enabled in the Run Configuration... which I hope exists when using a py.test Run Configuration. Since colour display is just a trick of a terminal emulator in interpreting control characters emitted to the console, it's up to PyCharm's terminal tool window renderer to also interpret those control sequences and display them properly.
@theY4Kman Thank you for your answer!
I don't have that option in the Run Configuration:
PyCharm 2023.3.4 (Professional Edition)
Build #PY-233.14475.56, built on February 25, 2024
macOS 14.2.1
I also didn't find it in Pycharm settings.
Apart from that, I really appreciate your suggestion and I understand if this is not a plugin issue.
I have this in my pytest.ini to show all logs above DEBUG level with colors.
That works fine when running tests with tox in my terminal. But this is not working when I run tests in Pycharm. Only the basic logs are shown.
I've also tried with
addopts=--log-cli-level=DEBUG --color=yes
But does not work.For that to work in Pycharm too, I have to add this as additional arguments in the Run Configuration Template:
--log-cli-level=DEBUG --color=yes
Note: the plugin DOES pickup my python_classes configuration:
python_classes = *Test *TestCase
Showing the green arrow to run those test classes. So the plugin is activated and working.It would be a nice feature to have, to avoid having duplicated config in pytest.ini and run configuration template.