pytest框架
shengshengman12
这个作者很懒,什么都没留下…
展开
-
pytest fixture学习笔记
这里写自定义目录标题1前言2 fixture作用域3 具体使用3.1function级别3.1.1代码实现3.1.2返回结果3.2 clsss级别3.2.1代码实现3.2.2返回结果3.3 moudle级别3.3.1 代码实现3.3.2 返回结果3.4 session级别3.4.1 代码实现3.4.2 返回结果4 调用方法5 源码解析1前言unittest中执行用例前后有setup,teardown操作,pytest中有fixture且比unittest更加灵活,fixture具有明确的名称,并通过在原创 2020-08-15 16:40:29 · 293 阅读 · 0 评论 -
pytest pytest.ini
1.概述pytest配置文件可以改变pytest的运行方式,它是一个固定的文件pytest.ini文件,读取配置信息,按指定的方式去运行。可以通过命令pytest --help查看pytest.ini的[pytest] ini-options in the first pytest.ini|tox.ini|setup.cfg file found: markers (linelist): markers for test functions empty_parameter_set_mark原创 2020-07-17 20:21:46 · 141 阅读 · 0 评论 -
pytest用例打标签
1.用例标签注册的方式1.1 pytest.ini[pytest]markers= webtest: Run the webtest case hello: Run the hello casewebtest是标签名称,Run the webtest case是注释1.2 conftest.pydef pytest_configure(config): config.addinivalue_line("markers",'webtest') config.addi原创 2020-07-17 19:35:04 · 922 阅读 · 0 评论