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 ...
随机推荐
- [COJ0968]WZJ的数据结构(负三十二)
[COJ0968]WZJ的数据结构(负三十二) 试题描述 给你一棵N个点的无根树,边上均有权值,每个点上有一盏灯,初始均亮着.请你设计一个数据结构,回答M次操作. 1 x:将节点x上的灯拉一次,即亮变 ...
- SAP EP 设置Portal别名安全模式
Securing the Portal Alias Cookie Context We recommend that you set the portal alias cookie to be del ...
- NOIP 2010 关押罪犯
P1525 关押罪犯 题目描述 SS 城现有两座监狱,一共关押着 NN 名罪犯,编号分别为 1-N1−N .他们之间的关系自然也极不和谐.很多罪犯之间甚至积怨已久,如果客观条件具备则随时可能爆发冲突. ...
- 系统无法安装 OfficeControl.ocx 控件如何解决
在OA上要直接查看word等公告文件,就必须安装office控件.要安装office控件,需要在IE浏览器中做相应的设置.如何设置呢,下面由小编具体介绍下. 工具/原料 OA IE浏览器 方法 ...
- Android GIS开发系列-- 入门季(12) 显示载天地图
在项目中可以经常需要动态加载一些图层,像投影地图服务.投影地图服务器.其实网上有大量这样的服务,比如天地图官网, . 随便点开一个服务,里面有相关的信息.那如何加载这样图层服务呢. 一.首先感谢这篇博 ...
- MariaDB基础操作
MariaDB: MariaDB是MySQL源代码的一个分支,随着Oracle买下Sun,MySQL也落入了关系型数据库王者之手.在意识到Oracle会对MySQL许可做什么后便分离了出来(MySQL ...
- UTF-8 的中文檔案名上傳問題
在上传文件后,一般都会用 move_uploaded_file() 进行文件移动改名.但是 move_uploaded_file() 并不支持 UTF-8 编码,如果含有,那么函数就会执行失败,但是这 ...
- JavaScript变量提升演示样例
直接先看两段代码 function getSum() { var sum = a + b; var a = 1; var b = 2; return sum; } getSum(); function ...
- cmd启动Oracle服务和监听服务
启动数据库服务 net start oracleserviceorcl 启动数据库监听 lsnrctl start
- web 开发之js---JS变量也要注意初始化
原先以为js作为弱类型语言,变量的初始化没必要,但是: var text; text+="你好"; alert(text); 对话框弹出的内容是:"undefined你好 ...