01 2022 档案

摘要:--durations用于计算每个用例执行的执行时间,并进行排序 > pytest -h --durations=N show N slowest setup/test durations (N=0 for all). --durations-min=N Minimal duration in se 阅读全文
posted @ 2022-01-21 14:52 小哈别闹 阅读(193) 评论(0) 推荐(1) 编辑
摘要:当用命令pytest执行用例时,控制台会输出很多信息,不方便追溯问题信息,可以通过--tb命令行参数控制输入信息内容 pytest -h 查看--tb参数的使用方法 > pytest -h --tb=style traceback print mode (auto/long/short/line/n 阅读全文
posted @ 2022-01-21 14:44 小哈别闹 阅读(198) 评论(0) 推荐(0) 编辑
摘要:获取测试用例的运行结果: #conftest.py import pytest @pytest.hookimpl(hookwrapper=True, tryfirst=True) def pytest_runtest_makereport(item, call): print(' ') # 获取钩子 阅读全文
posted @ 2022-01-21 14:15 小哈别闹 阅读(215) 评论(0) 推荐(0) 编辑
摘要:在Pytest中,conftest.py中方法命名越复杂时,就显得难以理解,这时可以使用别名来使代码更加容易解读 只需使用fixture中的name参数即可,案例如下: #conftest.py import pytest @pytest.fixture(scope="session",name=" 阅读全文
posted @ 2022-01-21 13:47 小哈别闹 阅读(37) 评论(0) 推荐(0) 编辑
摘要:在Windows系统上使用pip安装一些包时,“Microsoft Visual C++ 14.0 is required.”是个很常见的错误 首先确定你要安装的Visual C++编译器版本。每个Python版本都使用特定版本的编译器,因此需要安装与Python版本相对应的编译器: 直接用 Vis 阅读全文
posted @ 2022-01-01 22:15 小哈别闹 阅读(903) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示