随笔分类 -  自动化测试

摘要:about JDK是Java语言的软件开发工具包,主要用于移动设备、嵌入式设备上的java应用程序。JDK是整个java开发的核心,它包含了JAVA的运行环境,JAVA工具和JAVA基础的类库。 JRE(Java Runtime Environment,Java运行环境),运行JAVA程序所必须的环 阅读全文
posted @ 2020-01-21 13:30 干it的小张 阅读(179) 评论(0) 推荐(0)
摘要:可以根据下面的连接进行在线下载,也可以使用: 链接:https://pan.baidu.com/s/1CbuveTgJ43NaTwbyDaSiqg 提取码:bchj JDK简介 JDK是Java语言的软件开发工具包,主要用于移动设备、嵌入式设备上的java应用程序。JDK是整个java开发的核心,它 阅读全文
posted @ 2020-01-21 12:45 干it的小张 阅读(232) 评论(0) 推荐(0)
摘要:下载测试报告插件:pip install pytest-html 配置ini文件: [pytest]addopts = -s -v --html=report/report.htmltestpaths = ./scriptspython_files = test_case.pypython_clas 阅读全文
posted @ 2020-01-21 12:09 干it的小张 阅读(303) 评论(0) 推荐(0)
摘要:import pytestimport requests @pytest.fixture()def db(): print("Connection successful") yield print("Connection closed")def search_user(user_id): d = { 阅读全文
posted @ 2020-01-21 11:05 干it的小张 阅读(352) 评论(0) 推荐(0)
摘要:import pytestimport requests @pytest.fixture()def login(): print("登录.......")def test_index1(login): """测试之前先登录""" print("主页1..........")def test_inde 阅读全文
posted @ 2020-01-21 10:43 干it的小张 阅读(128) 评论(0) 推荐(0)
摘要:l1 = [10086, 10010, 110, 120]code = ["xxx","ppppp","oooo","wwww"]@pytest.mark.parametrize("mobile,code",zip(l1,code))def test_case(mobile,code): print 阅读全文
posted @ 2020-01-20 23:02 干it的小张 阅读(142) 评论(0) 推荐(0)
摘要:pytest.ini [pytest]addopts = -s -vtestpaths = ./scriptspython_files = test_case.pypython_classes = Test*python_functions = test_*xfail_strict = true t 阅读全文
posted @ 2020-01-20 20:52 干it的小张 阅读(130) 评论(0) 推荐(0)
摘要:import pytestdef test_case_01(): assert 1#无条件跳过类:@pytest.mark.skip()class TestCase(object): """加装饰器跳过测试用例""" @pytest.mark.skip(condition=True, reason= 阅读全文
posted @ 2020-01-20 20:25 干it的小张 阅读(247) 评论(0) 推荐(0)
摘要:目录结构: pytest.ini [pytest]addopts = -s -vtestpaths = ./scriptspython_files = test_*.pypython_classes = Test*python_functions = test_* test_case.py def 阅读全文
posted @ 2020-01-20 20:08 干it的小张 阅读(300) 评论(0) 推荐(0)
摘要:import pytestimport requestsclass TestCase(object): def test_case_01(self): """再执行三""" assert 1 def test_case_02(self): """再执行六""" assert {"title":"v2 阅读全文
posted @ 2020-01-20 19:08 干it的小张 阅读(246) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2020-01-20 18:32 干it的小张 阅读(136) 评论(0) 推荐(0)
摘要:import pytestimport requestsclass TestCase(object): def test_case_01(self): assert 1 def test_case_02(self): assert {"title":"v2ex"} != {"title":"V2EX 阅读全文
posted @ 2020-01-20 17:54 干it的小张 阅读(198) 评论(0) 推荐(0)
摘要:import pytestimport requests#定义预期结果:expect = {"title":"V2EX"}class TestCase(object): def test_case_01(self): assert 1 def test_case_02(self): assert { 阅读全文
posted @ 2020-01-20 13:25 干it的小张 阅读(300) 评论(0) 推荐(0)
摘要:import pytestimport requestsimport sys#建立数据库连接:def setup_function(): print("建立数据库连接成功...")def test_case_01(): assert 1#断开数据库连接:def teardown_function() 阅读全文
posted @ 2020-01-20 13:05 干it的小张 阅读(253) 评论(0) 推荐(0)
摘要:import pytestimport requests#定义预期结果:expect = {"title":"V2EX"}def test_case_01(): response = requests.get(url='https://www.v2ex.com/api/site/info.json' 阅读全文
posted @ 2020-01-20 13:04 干it的小张 阅读(323) 评论(0) 推荐(0)
摘要:About 在没完善一个程序之前,我们不知道程序在哪里会出错,与其让它在运行最崩溃,不如在出现错误条件时就崩溃。 这时,就要用到断言assert了,Python中的断言语句格式用法很简单。 断言 assert 是指期望用户指定的条件满足,它是当用户定义的约束条件不满足时触发AssertionErro 阅读全文
posted @ 2020-01-19 20:59 干it的小张 阅读(366) 评论(0) 推荐(0)
摘要:import timeimport requests#线程池、进程池from concurrent.futures import ThreadPoolExecutor,ProcessPoolExecutor#多线程:from threading import Thread#多进程:from mult 阅读全文
posted @ 2020-01-19 20:42 干it的小张 阅读(211) 评论(0) 推荐(0)
摘要:import timeimport requests#线程池、进程池from concurrent.futures import ThreadPoolExecutor,ProcessPoolExecutor#多线程:from threading import Thread#多进程:from mult 阅读全文
posted @ 2020-01-19 20:41 干it的小张 阅读(234) 评论(0) 推荐(0)
摘要:About psutil(python系统和流程实用程序)是一个跨平台库,用于在Python中检索有关正在运行的 进程和系统利用率(CPU,内存,磁盘,网络,传感器)的信息。它主要用于系统监视,分析,限制进程资源和运行进程的管理。它实现了UNIX命令行工具提供的许多功能,例如:ps,top,lsof 阅读全文
posted @ 2020-01-19 20:11 干it的小张 阅读(362) 评论(0) 推荐(0)
摘要:requests下载 pip install requests pip install -i https://doubanio.com/simple/ requests 常用的方法 响应 import requests ​ requests.get() requests.post() r = req 阅读全文
posted @ 2020-01-18 20:58 干it的小张 阅读(288) 评论(0) 推荐(0)