(二十五)pytest中conftest使用
Posted wx921308494
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了(二十五)pytest中conftest使用相关的知识,希望对你有一定的参考价值。
conftest中一般放置前置条件,比如登录等
1.在case目录下(有__init__.py文件),新建conftest.py文件
![技术图片](https://upload-images.jianshu.io/upload_images/16945005-b4fc0b96672b3ced.png?imageMogr2/auto-orient/strip|imageView2/2/w/787)
@wiiliam胡阳
2.在用例中添加
![技术图片](https://upload-images.jianshu.io/upload_images/16945005-a889cadf839f419f.png?imageMogr2/auto-orient/strip|imageView2/2/w/977)
@william胡阳
以上是关于(二十五)pytest中conftest使用的主要内容,如果未能解决你的问题,请参考以下文章