pytest内置fixture request
时间: 2023-10-12 18:03:02 浏览: 162
pytest内置的fixture "request" 是一个特殊的fixture,它可以用来访问当前测试用例的请求信息。通过使用request.fixturename的形式,我们可以在测试代码中获取fixture的值。比如,可以使用request.getfixturevalue(request.param)来获取参数化fixture的值。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Python测试框架pytest fixture - 依赖、重命名、request、pytestconfig](https://blog.csdn.net/m0_58656539/article/details/119460227)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [pytest系列——内置fixture函数之pytestconfig详解](https://blog.csdn.net/mashang_z111/article/details/127188466)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文