随笔分类 - pytest
摘要:Fixture Request 详情见: 1 获取正在执行的夹具名称 @pytest.fixture def get_request_data(request: pytest.FixtureRequest): return request.fixturename 2 获取所有活动的fixture名称
阅读全文
摘要:断言assert声明 pytest允许您使用标准 Pythonassert来验证 Python 测试中的期望值和值。例如,您可以编写以下内容: # content of test_assert1.py def f(): return 3 def test_function(): assert f()
阅读全文
摘要:通常,使用命令调用 pytest(有关调用 pytest 的其他方法,pytest请参见下文)。这将在名称遵循表单的所有文件中或 在当前目录及其子目录中执行所有测试。更一般地说,pytest 遵循标准测试发现规则。test_*.py*_test.py 完整的 pytest 命令行标志参考,pytes
阅读全文

浙公网安备 33010602011771号