上一页 1 2 3 4 5 6 7 8 9 ··· 15 下一页
摘要: 阅读全文
posted @ 2022-05-08 17:16 lms21 阅读(10) 评论(0) 推荐(0)
摘要: 例子: @pytest.mark.skip 跳过该case @pytest.mark.skip(reason="代码无实现") @pytest.mark.add def test_add_02(): assert (2+2) == 3 @pytest.mark.skipif 如果满足sys.plat 阅读全文
posted @ 2022-05-08 17:02 lms21 阅读(77) 评论(0) 推荐(0)
摘要: 场景 只执行符合要求的某一部分用例,可以把项目划分为多个模块,然后制定模块名执行 用法 在测试用例方法上加@pytest.mark.标签名 执行 -m 执行自定义标记的相关用例 import pytest @pytest.mark.add def test_add_01(): assert (1+1 阅读全文
posted @ 2022-05-08 16:17 lms21 阅读(35) 评论(0) 推荐(0)
摘要: 参数化函数使用 使用装饰器 @pytest.mark.parametrize(参数,值) 单参数 只传一个参数 search_list = ['appinum','pytest'] @pytest.mark.parametrize('name',search_list) def test_demo( 阅读全文
posted @ 2022-05-08 15:55 lms21 阅读(67) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-05-08 15:27 lms21 阅读(16) 评论(0) 推荐(0)
摘要: 实例: def test_answer(): assert inc(4) == 5,"error"def test_str(): assert "abc" in "abcdd"def test_sys(): assert 'linux' in sys.platform,"no linux!" 阅读全文
posted @ 2022-05-08 12:30 lms21 阅读(18) 评论(0) 推荐(0)
摘要: 通常创建测试类就遵循上面实例样式 阅读全文
posted @ 2022-05-08 12:13 lms21 阅读(18) 评论(0) 推荐(0)
摘要: pycharm 配置与界面化运行 安装pytest 界面安装(Windows) Settings-->python interpreter-->+ pip 配置默认测试执行器为pytest Settings-->Tools-->Python Intergrated Tools 选择Defaul te 阅读全文
posted @ 2022-05-08 12:06 lms21 阅读(361) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-05-08 11:58 lms21 阅读(12) 评论(0) 推荐(0)
摘要: Pytest 是什么? pytest 能够支持简单的单元测试和复杂的功能测试; pytest 可以结合 Requests 实现接口测试; 结合 Selenium、Appium 实现自动化功能测试; 使用 pytest 结合 Allure 集成到 Jenkins 中可以实现持续集成。 pytest 支 阅读全文
posted @ 2022-05-08 11:48 lms21 阅读(86) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 15 下一页