上一页 1 ··· 6 7 8 9 10
摘要: 1 什么是fixture @pytest.fixture def my_fruit(): return Fruit("apple") 如上,用@pytest.fixture装饰的函数就是fixture 2 fixture的作用 我的理解是为test函数的运行提供数据、必要的环境支持等 3 fixtu 阅读全文
posted @ 2023-05-04 16:53 工作手记 阅读(28) 评论(0) 推荐(0)
摘要: ##如上官网所说,pytest使用python中的assert来比较实际值与预期值,实现断言功能 ##1 常用的断言方式 assert xxx assert a == b assert a!=b assert a > b assert a <b assert a in b assert a not 阅读全文
posted @ 2023-05-02 21:10 工作手记 阅读(400) 评论(0) 推荐(0)
摘要: 1 pytest xxxx 2 python -m pytest xxxx python -m pytest --html=./report/rep2.html test_env_pytest_ini.py 这个与pytest几乎是相同的,官网是这样说的 3 python pytest xxx 这与 阅读全文
posted @ 2023-05-01 23:27 工作手记 阅读(210) 评论(0) 推荐(0)
摘要: 一、pytest有很多命令行选项如 -v 输出详细信息 -q 简要输出 -s 打印输出 -k "xxx" 在file name、class name、function name来匹配xxx规则,pytest只运行符合匹配结果的部分 -m xx 寻找具有xx mark的test来运行或不运行 -x 遇 阅读全文
posted @ 2023-04-30 21:53 工作手记 阅读(173) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10