有时很难理解为什么会执行一些夹具代码,而似乎不应该执行。因此,我想打印所有的夹具名称,这将解决一些具体的测试,为更详细的分析,是否有这样的特点?
发布于 2021-06-24 21:35:14
在pytest中有这样的特性吗?
是。
我想打印所有的夹具名称,这将被解析为一些具体的测试用pytest
您可以先看看这些输出:
pytest --fixtures # show fixtures
pytest --fixtures -v # show fixtures also with leading _
pytest --fixtures-per-test # show fixtures per test如果这还不够,您还可以查看以下内容:
pytest --setup-only
pytest --setup-planhttps://stackoverflow.com/questions/68122898
复制相似问题