在Pytest中,如何抑制某些日志记录出现在stdout上?

时间:2020-08-27 15:25:27

标签: python-3.x logging pytest stdout

我正在使用Python 3.8和pytest 6.0.1。当我在命令行上运行测试时,我会看到这样的日志输出...

INFO     azure.core.pipeline.policies.http_logging_policy:_universal.py:458     'x-ms-server-encrypted': 'REDACTED'
INFO     azure.core.pipeline.policies.http_logging_policy:_universal.py:458     'Date': 'Thu, 27 Aug 2020 15:17:48 GMT'
ERROR    root:__init__.py:59 contnts: b'098273' code: 098273

如何配置pytest以禁止某些类型的调试-例如我只想显示“错误”日志记录。

0 个答案:

没有答案
相关问题