pygments lexer用于pytest输出。
pygments-pytest的Python项目详细描述
pygments pytest
pygments lexer用于pytest输出
见some demos!或者 see it in action on pytest.org。
安装
pip install pygments-pytest
用法
此库提供名为pytest
的pygments lexer。
..code-block::pytest $ pytest test.py ========================== test session starts =========================== platform linux -- Python 3.6.6, pytest-4.0.1.dev43+g0d529847.d20181123, py-1.7.0, pluggy-0.8.0 rootdir: /home/asottile/workspace/pytest, inifile: tox.ini collected 1 item test.py . [100%] ======================== 1 passed in 0.01 seconds ========================
这个库还提供了sphinx扩展。可以通过添加
'pygments_pytest'
到conf.py
中的extensions
设置。
可以使用sphinx设置调整颜色(在conf.py
)
pygments_pytest_ansi_colors
:
pygments_pytest_ansi_colors={'Cyan':'#06989a','Green':'#4e9a06','Red':'#c00','Yellow':'#c4A000',}