小编ken*_*ong的帖子

py.test可以支持多个-k选项吗?

py.test可以支持多个-k选项吗?每个测试用例属于特定的组,例如_eventnotification或_interface等.是否可以同时运行属于一个或两个的测试用例?即,运行在名称中同时具有_eventnotification或_interface的测试用例.我尝试了以下操作,只执行了带有_interface的测试用例.如果不支持,还有其他方法吗?

py.test -k"_eventnotification"-k"_interface"

pytest

5
推荐指数
1
解决办法
737
查看次数

需要 py.test 从 python 日志模块记录日志文件中的断言错误

需要 py.test 从 python 日志模块记录日志文件中的断言错误。该测试设置了 python 日志记录模块,所有日志都按预期进行。我在整个测试中使用了断言语句。但是当遇到断言错误时,这些消息不会记录在 python 日志输出中,而是记录在命令控制台中。

有没有办法让 py.test 在测试的日志输出中记录断言错误?

Right now the errors are in command console but it would be great if these assertion errors are also logged as part of python logging output so all the log messages are captured in one place. Also, for long running test, I cannot see the errors until the entire test finish which could be a long time to wait. It would be great if I can see the …

python assert pytest

1
推荐指数
1
解决办法
3184
查看次数

标签 统计

pytest ×2

assert ×1

python ×1