Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用实时日志设置时避免默认打印pytest日志_Python_Logging_Output_Pytest - Fatal编程技术网

Python 使用实时日志设置时避免默认打印pytest日志

Python 使用实时日志设置时避免默认打印pytest日志,python,logging,output,pytest,Python,Logging,Output,Pytest,在Pytest执行期间,我看到Pytest日志在测试文件中的方法执行后打印出来 我已经使用Live log设置来快速获取所需格式的日志。但是这些红色打印的pytest日志破坏了控制台的整体吸引力,使事情变得麻烦。大概是这样的: 调试一个位后,我在runner.py模块中将log=true作为导致此问题的默认参数,找出了call_和_report方法。我认为应该有一些选择来抑制这种情况 有人能帮我解决这个问题吗 请注意,使用pytest-s和其他可能的东西都是尝试过的,但没有成功。您是否尝试过p

在Pytest执行期间,我看到
Pytest
日志在
测试文件中的方法执行后打印出来

我已经使用Live log设置来快速获取所需格式的日志。但是这些红色打印的pytest日志破坏了控制台的整体吸引力,使事情变得麻烦。大概是这样的:

调试一个位后,我在
runner.py
模块中将
log=true
作为导致此问题的默认参数,找出了
call_和_report
方法。我认为应该有一些选择来抑制这种情况

有人能帮我解决这个问题吗


请注意,使用
pytest-s
和其他可能的东西都是尝试过的,但没有成功。

您是否尝试过
pytest-q
?是@blues。那没什么区别。