python自动化测试学习笔记-unittest参数化
做接口测试的时候,当一个参数需要输入多个值的时候,就可以使用参数来实现;
python中unittest单元测试,可以使用nose_parameterized来实现;
首先需要安装:pip install nose-parameterized,导入该模块;
看下面的例子,一般我们写测试用例的时候会追条定义一个test*()的方法,然后执行所有测试用例,如下:
import unittest
def calc(a,b):
res=a+b
return res class MyTest(unittest.TestCase): def test1(self):
res=calc(1,2)
self.assertEqual(res,3) def test2(self):
res=calc(0,0)
self.assertEqual(0,0) if __name__ == '__main__':
unittest.main() 执行查看结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAABiCAIAAAAHuZelAAAGDUlEQVR4nO3d3U9TZxzA8RNi9MaUEEMTTBpiNEQvvDBGYpqgJN5gAnrNjUHEC6/8D6xZpdihWdwqJYC6xOCgMwyVC7KwTGYVEhEmaMRMCTJg4nCMrqU9fdmzi7MxAn05dpD9Yr+f9KLnyfOc85ybb05oUzQFABBJ+783AABIjkADgFAEGgCEItAAIBSBBgChCDQACEWgAUAoAg0AQpkKdHt1dcYRAMD64gkaAIQi0AAgFIEGAKEINAAIRaABQCgCDQBCEWgAEIpAA4BQBBoAhCLQACAUgQYAoQg0AAhFoAFAKAINAEJlDrRD01a+GGGEEUY+yhGBhG4LAECgAUAoAg0AQhFoABCKQAOAUAQaAIQi0AAgFIEGAKEINAAIRaABQCgCDQBCEWgAEIpAA4BQBBoAhCLQACCU6d+Dzsu7vHv3j7dvZ32luZcvr1dWOvPzPaWlr/r7sz7P+vrqxIkPmh+NRL4+fdppsXTU1ETDYZNzkq6K6/r1ysr/uH8AH7HMgdZDIYemxXX9zePHDUVFWV+ps7Z2YWpKX1oaaG1t3LUr5eWCwSx+PDu7VVnwe70PvV59aWns7l2/x2NyTtJVkn8mHIAEpgJhdGRycDBNWDO6ceyY8UYPhS6VlKSa9qq/P4tsZbcqC96ysuD8vFIqHAg02e0m5yRdFY1ECDSANMwG2qFpTotl7M4dY2TE57tUUtK4c+eE3788oc/l8pSWz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h2UOtMtqTcRiSqm4rrusVmPQoWkTjx7dqKoy2g0AWHeZA+09fHhpYUEpFZyf9x46ZAz+/Qmhy+X3eDZ0fwCQszIHevDatcc3b+rB4GBb28PmZvXPh4R6KBReXHTbbDOjoxu/TwDIOZkDHY9Gb58547RYfHV1q75m9+zeveXv2wEA1hdtBQChCDQACEWgAUAoAg0AQhFoABCKQAOAUAQaAIQi0AAgFIEGAKEINAAIRaABQCgCDQBC/QVKbGmMob+RbwAAAABJRU5ErkJggg==" alt="" />
当传入的值类型相同,我们可以用读取list的方式,进行参数化,自动调用执行,如下:
import unittest
import nose_parameterized
def calc(a,b):
res=a+b
return res
data=[
[1,2,3],
[0,0,0],
[9999,0,9999]
]
class MyTest(unittest.TestCase):
#参数化,自动的运行list里边的数据
@nose_parameterized.parameterized.expand(data)
def test1(self,a,b,e):
res=calc(a,b)
self.assertEqual(res,e) if __name__ == '__main__':
unittest.main()
上述我们只需要定义一个测试用例方法,使用parameterized方法自动运行data里边的数据,查看执行结果,看到执行了三次:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbkAAABiCAIAAABCuDonAAAF3UlEQVR4nO3dT0yTZxzA8TfE6IXUgKEJmoYYjZGDB+OfaBOUhAsHiSdNuBhEjPHkwbs1goWOmcUJFBucywxOOuJAPJCFZTirkog4gUUSJ2EKLGS4Cmlp37bk2eHdmClv+3utC3/0+wmH9pfnffu8l2/epk3RFABAoi33BgBgFaCVACCjlQAgo5UAIKOVACCjlQAgM29la3l5BhMA+FhxXwkAMloJADJaCQAyWgkAMloJADJaCQAyWgkAMloJADJaCQAyWgkAMloJADJaCQAyWgkAMloJADKTVro07d0/JkyYMPkoJ++F+0oAkNFKAJDRSgCQ0UoAkNFKAJDRSgCQ0UoAkNFKAJDRSgCQ0UoAkNFKAJDRSgCQ0UoAkNFKAJDRSgCQpf79yqysS9u3/9LenvGpn7W3X9m9+0J2duP+/S96ez9gk/+nb48de6/1sWj0u5Mnq222WxUVsUjE4horEwCriE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jkUhbZWW1zeY/cSKu60opl6YZf0qpntpa4wEAfDpMqhdoaHh2+3ZC15+2tT3y+ZRSejjs0rRYNPrU7/dXVQXHx5d8nwCwnExa2eR0RmZmlFLhYLC5uNgYujTtkc93ft26yaGhJd0gAKwAJq28uGHDfCKhlJqPxy/m5RlDl6a5srJ6amuXdHcAsDKYtNJtt8/H40qphK677XZj6NK00YcPr5eVGRkFgE+KSSu9Bw/OBYNKqdD0tPfAAWP4zwc7bnegoWEp9wcAK4FJK/uuXXt844YeCvW1tDxoblb/frajh8ORmRmPwzExOLjk+wSA5WTSykQs1n76dLXN5q+qSvrO0HBX18KXhwDg00H1AEBGKwFARisBQEYrAUBGKwFARisBQEYrAUBGKwFARisBQEYrAUBGKwFARisBQEYrAUBGKwFA9jfzBb0oLqeW0AAAAABJRU5ErkJggg==" alt="" />
还可以通过调用文件的方式来进行unittest参数化;如果测试数据存在于文件中,首先我们需要定义一个将文件转化成list的方法,我们可以根据文件的不同类型使用不同的方法,封装一个tool模块,定义DataToParam类
import os
import xlrd class DataToParam(object):
def file_exist(self,filename):
if os.path.isfile(filename):
return True
else:
raise Exception('参数化文件不存在') def text(self,filename):
if self.file_exist(filename):
with open(filename,'r',encoding='utf-8') as f:
list=[]
for line in f :
list.append(line.strip().split(','))
return list def excel(self,filename):
if self.file_exist(filename):
book=xlrd.open_workbook(filename)
sheet=book.sheet_by_index(0)
rows=sheet.nrows
list=[]
for row in range(rows):
list.append(sheet.row_values(row))
return list
调用DataToParam中的函数,将文件转化成list
文件:aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAP4AAABiCAIAAAD/UPk+AAAFfklEQVR4nO2daXLiMBBGfZW5SyoXmmNRKbJSZCXJGdj37QY5QM8PeSgFLMo2rba7/b1KBeyUjT7yLCRLxgmF+fn5Wf3nsHK/35/ZhJGrq6vDbwFkch3FEUgnkOs0hUCur6+vzWUkoV373vvqb7fb2KkcwurL5PLjyEQTyCX2P/Lp9XpR1D/y3ld/vV7LZB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w16u5AS3Ht3cMmT6QcoVIbu5HDjDcylWz4RYzXUglvrNGdIKfYCSckWs5nLEavCcd92Y+mcwoEgmJnNBfU5MKkJGc/Goj6u0gDp4rtIqeqzg2lxdmMwF9TkxqQghVxionwJFdAH12YAiuoD6bEARXbCp35AvGXeo+IK+zEuuSqxHrmBJ3ENz1A9NBqyVIn7ZLnlOyHWmMESU//aJpFx9LXNdQuUsup6Q60xhnPRQH4oIUKtczWrwaFTEb+kWXU/IdaYw7gHq10oR+t29OzUg/3rkCpakUbeWUKS+z+n5jfzrkSv46u4BtT4UkQfqixLqQtVNkdJdQOTKWxL6f3KzCQ0ex1GHyVFDRTLLWXQ9cgVLUnQDA+pnUjdFuECuEFA/BYrogkH9/X6/2+222+1ms1mv16vVarlcLhaL+Xw+m82m0+lkMhmPx6PRaDgcDgaDVqvFfc0NABWAWj+lj9pRFZfngvopUEQXUJ8NKKILqM8GFNEF1GcDiuiCQf1GzeE5AxTRBWp9NqCILqA+G1BEFzzq52/tENTXBnKFSHzj0da3B3KF+NXggfr2QK4QUD8FiugC6rMBRXQB9dmAIrpgHtLKswHU1wVyhfgHrrdhzczUXs0AAAAASUVORK5CYII=" alt="" />
import unittest
from tool import DateToParam
import nose_parameterized
def calc(a,b):
res=a+b
return res
class MyTest(unittest.TestCase): #参数化,自动的运行list里边的数
@nose_parameterized.parameterized.expand(DateToParam.excel(r'C:\test\test.xlsx')) def test_func(self,a,b,e):
e=float(e)
res=calc(a,b)
self.assertEqual(res,e) if __name__ == '__main__':
unittest.main()
执行查看结果:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAecAAABrCAIAAADCat0UAAAGF0lEQVR4nO3dT0iUaRzA8ReJusSEhAMGg0QRdegQUcSAJXTxkHT2EmZ2iA4dOkSXJjLHZl1Z2jVHRLeFqM2pbe3PgojL5jalkFmNLgprrtuqJdrOKjPOvO+MPHt4N9dVZ+ZJy+VX3w8eZn487/s+7+XLSzOpoQAAchj/9wYAAO+AagOAJFQ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ZT6qarKfvHLvXuVubnXS0pq3e6GwsKFf68+1dle9/XdOXmy9dy58PBwqjUvHjz4Yvv2J9eu2W//ePLkq127zmdnt5w5Y0++PnDgwoYN57OzW8vLUx216Jo0tzbvbaq7sOLxQFnZubVrrx8+bMXj9vBqcXH6NToTzT0DAP83EgAkodoAIAnVBgBJqDYASEK1AUASqg0AklBtAJCEagOAJFQbACSh2gAgCdUGAEmoNgBIQrUBQBKqDQCSUG0AkIRqA4AkVBsAJKHaACAJ1QYASag2AEhCtQFAEqoNAJJQbQCQhGoDgCRUGwAkodoAIAnVBgBJqDYASEK1AUASqg0AkmSothWLNZWWljscgSNHEqaplPIYhv2jlGqrrLRfAABWRobmBmtqnt+6lTTNp01NHfX1SikzGvUYhhWPPw0EAmVl4eHhFdknAECpjNWudbtjk5NKqWg4XFdQYA89htFRX392zZrRnp4PvkEAwBwZql2xfv1MMqmUmkkkKnJy7KHHMDxZWW2VlR98dwCA/8pQba/TOZNIKKWSpul1Ou2hxzAGHz26XFRkBx0AsGIyVNu/b990OKyUikxM+PfutYf/fBTp9QZraj70/gAAc2Wodmdj4+MrV8xIpLOh4WFdnXr7aaQZjcYmJ30u10gotCL7BAAolbHaScu6eexYucMRKCub982/3rt3Z78CCABYGTQXACSh2gAgCdUGAEmoNgBIQrUBQBKqDQCSUG0AkIRqA4AkVBsAJKHaACAJ1QYASag2AEhCtQFAEqoNAJJQbQCQhGoDgCRUGwAkodoAIMnfPc+Y5FEversAAAAASUVORK5CYII=" alt="" />
python自动化测试学习笔记-unittest参数化的更多相关文章
- python自动化测试学习笔记-8单元测试unittest模块
官方参考文档:http://docs.python.org/2.7/library/unittest.html unittest是一个python版本的junit,junit是java中的单元测试框架 ...
- python自动化测试学习笔记-10YAML
之前学习的编写测试用例的方法,都是从excel中编写接口的测试用例,然后通过读取excel文件进行接口自动化测试,这种方式我们叫做数据驱动的方式,由于excel操作起来不灵活,无法实现关联关系的接口测 ...
- python自动化测试学习笔记-1
一.什么是自动化 自动化测试是把以人为驱动的测试行为转化为机器执行的一种过程.直白的就是为了节省人力.时间或硬件资源,提高测试效率,便引入了通过软件或程序自动化执行测试用例进行测试: 二.python ...
- python自动化测试学习笔记-9测试框架
学习了这么久的python,我们已经可以自己搭建一个简单的测试和框架了,先从简单的开始,有时我们编写接口的测试用例会用excel进行编写,以下面的接口测试用例模板为例,进行编写:
- python自动化测试学习笔记-6urllib模块&request模块
python3的urllib 模块提供了获取页面的功能. urllib.request.urlopen(url, data=None, [timeout, ]*, cafile=None, capat ...
- python自动化测试学习笔记-5常用模块
上一次学习了os模块,sys模块,json模块,random模块,string模块,time模块,hashlib模块,今天继续学习以下的常用模块: 1.datetime模块 2.pymysql模块(3 ...
- python自动化测试学习笔记-4常用模块
常用模块 1.os 2.sys 3.random 4.string 5.time 6.hashlib 一.os模块 os模块主要用来操作文件.目录,与操作系统无关.要使用os模块首先要导入OS模块,用 ...
- python自动化测试学习笔记-4内置函数,处理json
函数.全局变量 写代码时注意的几点事项: 1.一般写代码的时候尽量少用或不用全局变量,首先全局变量不安全,大家协作的情况下,代码公用容易被篡改,其次全局变量会一直占用系统内容. 2.函数里如果有多个r ...
- python自动化测试学习笔记-2-列表
上次我们学习了python的基本概念,了解了python的变量及数据类型,并实战了条件判断,for/while循环,字符串输出,格式化输出的一些基本用法,接下来我们继续学习其他的一些数据类型. pyt ...
随机推荐
- windows PHP配置随笔
这几天配置本地windows wnmp(windows + nginx + mysql + php 5.3)遇到了不少问题.决定以后随笔记下解决的问题. #php.ini 配置含路径的值时,要注意把使 ...
- codevs——1081 线段树练习 2
1081 线段树练习 2 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 大师 Master 题解 题目描述 Description 给你N个数,有两种操作 1:给 ...
- codevs——1742 爬楼梯
1742 爬楼梯 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题解 题目描述 Description 小明家外面有一个长长的楼梯,共N阶.小明的 ...
- lambda简单记录
lambda表达式对集合的一些操作,持续记录一下新的用法 List<Integer> list = new ArrayList<>(); list.add(1); list.a ...
- SQL Server转sqlite数据库
下载地址:http://files.cnblogs.com/jason-davis/SQL_Server_To_SQLite_DB_Converter_bin.zip 下载地址:http://file ...
- firemonkey获取当前文件所在路径的方法
在之前,我们知道有三种方法: ExtractFilePath(ParamStr(0)) ExtractFilePath(Application.ExeName) GetCurrentDir + '\' ...
- 用Visual Studio 2010 打开Visual Studio 2013 (C#专用)
1.更改.sln 1)将Microsoft Visual Studio Solution File, Format Version 12.00 改成11.00 2)将 # Visual Studi ...
- web常见之音乐播放器
代码来源于:这位Github小伙伴,我只负责解说! 效果图如下: 先上HTML代码 源码: <!DOCTYPE html> <html> <head> <me ...
- CodeForces484A Bits(贪心)
CodeForces484A Bits(贪心) CodeForces484A 题目大意:给出范围[A.B].期望你给出某个数X满足X属于[A,B],而且X转成二进制的1的个数最多.假设有多个给出最小的 ...
- vuex资料
vuex最简单.最详细的入门文档 链接:https://segmentfault.com/a/1190000009404727 https://www.jb51.net/article/138239. ...