Believe in yourself.

1 2 3 4 5 ··· 11 下一页
摘要: 在django中创建一个用户的模型: class User(models.Model): name = models.CharField(max_length=256) image = models.ImageField(upload_to='images/') introduce = models 阅读全文
posted @ 2020-12-31 15:22 eastonliu 阅读(1581) 评论(0) 推荐(0) 编辑
摘要: python中,一般在涉及到列表排序时,都用内置的sort()方法或者全局的sorted()方法,区别如下: 1、sort()方法只能用于列表排序,不能用于字符串,字典等其他可迭代序列;sorted()方法可以用于所有的可迭代序列; 2、sort()方法是在原列表基础上进行排序,返回None,会破坏 阅读全文
posted @ 2020-12-28 13:57 eastonliu 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 一、环境准备 操作系统:Centos7.6 jdk:1.8.0 二、Jenkins安装 一、yum在线安装方式 系统能连接外网,可以采用下列yum在线安装方式 1、导入yum镜像 sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenki 阅读全文
posted @ 2020-12-16 10:59 eastonliu 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 在pytest中也有类似于unittest中的setup和teardown功能的默认函数或方法: 函数级(setup_function/teardown_function) 方法级(setup_method/teardown_method) 类级(setup_class/teardown_class 阅读全文
posted @ 2020-12-15 17:16 eastonliu 阅读(566) 评论(1) 推荐(0) 编辑
摘要: 可以使用pytest.mark.parametrize装饰器来对测试用例进行参数化。 对列表中的对象进行循环,然后一一赋值,这个对象可以是列表,元组,字典。 import pytest def add(a, b): return a + b @pytest.mark.parametrize("a,b 阅读全文
posted @ 2020-12-09 17:18 eastonliu 阅读(588) 评论(0) 推荐(0) 编辑
摘要: pytest.ini配置文件可以改变pytest一些默认的运行方式,如:用例收集规则,标签,命令行参数等等。 基本格式如下: # 新建pytest.ini文件,一般放在项目的顶级目录下,不能随意命名 [pytest] addopts = -v --rerun=2 --count=2 xfail_st 阅读全文
posted @ 2020-12-09 16:42 eastonliu 阅读(5011) 评论(0) 推荐(1) 编辑
摘要: 使用xfail标记希望的测试用例失败,会运行此测试用例,但是在报告中会将其列在“预期失败”(XFAIL)或“意外传递”(XPASS)部分,如下: import pytest @pytest.mark.xfail(reason="这个用例实际返回结果与预期不一致") def test_001(): a 阅读全文
posted @ 2020-12-09 16:14 eastonliu 阅读(452) 评论(0) 推荐(0) 编辑
摘要: 在执行测试用例时,有些用例可能不需要执行,这时可以用skip来跳过用例: 1、skip 始终跳过该测试用例 如下三个用例,标记用例2不执行 import pytest def test_001(): assert 1 == 1 @pytest.mark.skip(reason="此条用例暂不执行") 阅读全文
posted @ 2020-12-09 16:13 eastonliu 阅读(1218) 评论(0) 推荐(0) 编辑
摘要: 下面一段代码: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> #box{ height: 200px; width: 200px; } </style> </h 阅读全文
posted @ 2020-11-25 15:38 eastonliu 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 1、获取响应头Content_type var header_data=postman.getResponseHeader("Content_type") 2、获取响应码 var code = responseCode.code; 3、获取响应行中状态码名称 var code_name = resp 阅读全文
posted @ 2020-09-02 15:32 eastonliu 阅读(2401) 评论(0) 推荐(0) 编辑
1 2 3 4 5 ··· 11 下一页