本文主要是介绍How to use “print“ in behave,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
python自动化使用behave框架, 代码中的print函数无法输出log. 需要在behave.ini中添加配置. 然后运行命令添加相应参数 behave -k --tags=@test --no-capture
First, before anything else:
You are entering and comparing strings and not numbers in your steps.
Per default, behave captures stdout. This captured output is only shown if a failure occurs.
This behaviour is sufficient for most cases.
If you do not like that, disable it by using options --no-capture, --no-capture-stderr, --no-logcapture. One approach for you could be that you do not capture logging data (and write that to a file). For example, store your desired default value for the options in behave.ini:
– FILE: behave.ini
SEE: behave/configuration.py or read the docs.
[behave]
stdout_capture = true
stderr_capture = false
log_capture = false
SEE ALSO:
问题原链接
这篇关于How to use “print“ in behave的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!