macos - 在终端中更改 Pytest 颜色输出

标签 macos terminal python-3.6 pytest

我正在尝试在终端中更改 pytest 的颜色输出,但未能这样做。我当前在终端中更改颜色输出的设置是 here ,但似乎不适用于 pytest。然而,pytest 输出目前已着色,但我想更改颜色。例如,当运行 pytest 测试时出现错误,输出为红色,而我希望它为蓝色。

如何更改 pytest 颜色输出中使用的颜色?

最佳答案

你可以试试猴子补丁 LOGLEVEL_COLOROPTS 但我怀疑你能取得多大成就。似乎颜色是硬编码的。参见例如 terminal.py .

关于macos - 在终端中更改 Pytest 颜色输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50067571/

相关文章:

terminal - Windows 10 更新后,visual studio code 终端以淡蓝色突出显示

php - 为什么在以下情况下未导入数据库转储?

python - python何时复制添加到全局字典的本地列表?

python - 在子进程中重定向ffmpeg的输出

python - 在 pycharm (Windows) 中找不到模块

python - 我可以在 macOS 上使用 win32com 客户端吗?

c++ - 我可以在 mac 命令行应用程序与 mac 应用程序之间进行通信吗

macos - 导入 matplotlib 时 numpy 的版本错误

macos - gdb 布局 asm 在 mac 上不起作用?

ios - 如何从终端更新 Visual Studio for Mac/Xamarin Studio?