python 几种常见的测试框架
1. unittest
参考文档: https://docs.python.org/3/library/unittest.html
The unittest unit testing framework was originally inspired by JUnit and has a similar flavor as major unit testing frameworks in other languages. It supports test automation, sharing of setup and shutdown code for tests, aggregation of tests into collections, and independence of the tests from the reporting framework.
跟 JUnit类似。
2. unittest2
参考文档: https://pypi.python.org/pypi/unittest2
unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7 and onwards.
unittest2 是一个针对 unittest测试框架新特性的补丁。
3. pytest
参考文档:http://pytest.org/latest/
unittest is the Python standard library testing framework. It is sometimes known as PyUnit and has a rich heritage as part of the xUnit family of testing libraries.
也就是说 pytest 就是 unittest。
4. nose
参考文档: https://nose.readthedocs.org/en/latest/
基于Python的测试驱动开发实战 也有nose的用法: http://python.jobbole.com/81305/
nose extends unittest to make testing easier.
nose扩展了unittest,从而使得测试更容易。
5. doctest
参考文档:https://docs.python.org/3/library/doctest.html
Python 各种测试框架简介(一):doctest http://my.oschina.net/lionets/blog/268542
The doctest module searches for pieces of text that look like interactive Python sessions, and then executes those sessions to verify that they work exactly as shown.
doctest模块会搜索那些看起来像交互式会话的 Python 代码片段,然后尝试执行并验证结果。
python 几种常见的测试框架的更多相关文章
- Python几种常用的测试框架
一.测试的常用规则 一个测试单元必须关注一个很小的功能函数,证明它是正确的: 每个测试单元必须是完全独立的,必须能单独运行.这样意味着每一个测试方法必须重新加载数据,执行完毕后做一些清理工作.通常通过 ...
- 基于Python的接口自动化-unittest测试框架和ddt数据驱动
引言 在编写接口自动化用例时,我们一般针对一个接口建立一个.py文件,一条接口测试用例封装为一个函数(方法),但是在批量执行的过程中,如果其中一条出错,后面的用例就无法执行,还有在运行大量的接口测试用 ...
- python自动化测试学习笔记-9测试框架
学习了这么久的python,我们已经可以自己搭建一个简单的测试和框架了,先从简单的开始,有时我们编写接口的测试用例会用excel进行编写,以下面的接口测试用例模板为例,进行编写:
- python几种常见的模块安装方法
1. 在线安装 1.1 在命令提示符中运行 pip install package_name 指令 注:具体前置步骤和教程:http://www.cnblogs.com/jfl-xx/p/72895 ...
- Selenium(Python)页面对象+数据驱动测试框架
整个工程的目录结构: 常用方法类: class SeleniumMethod(object): # 封装Selenium常用方法 def __init__(self, driver): self.dr ...
- Selenium3+python自动化014-自动化测试框架的作用
1.能够有效组织和管理测试脚本 2.进行数据驱动或者关键字驱动的测试 3.将基础的测试代码进行封装,降低测试脚本编写的复杂性和重复性 4.提高测试脚本维护和修改的效率 5.自动执行测试脚本,并自动发布 ...
- python几种常见语法
NO1.type自动匹配类型 name="zhangsan"age=18 print (type(name))#type自动匹配类型 print ("name:%s,ag ...
- python 几种常用测试框架
测试的常用规则 一个测试单元必须关注一个很小的功能函数,证明它是正确的: 每个测试单元必须是完全独立的,必须能单独运行.这样意味着每一个测试方法必须重新加载数据,执行完毕后做一些清理工作.通常通过se ...
- 用 Python 测试框架简化测试
用 Python 测试框架简化测试 摘要:本文将向您介绍了三种流行 Python 测试框架(zope.testing,py.test,nose)的基本特性,并讨论新一代的测试风格. 最近出现了行业级的 ...
随机推荐
- eclipse alt + '/' not working.
searching for google,I observed that the 'content assist' shortcut key was take placed with 'ctrl + ...
- $.cookie('name', null) 删除cookie 失效问题
这几天在做网站的用户登录和退出功能,我使用jquery.cookie.js来操作cookie,但是用$.cookie('name', null) 总是失效, 后来使用$.cookie("na ...
- 2016年9月ccf
去长沙理工考ccf.恰好又可以见闺蜜. 前2道题很简单,第三题题目太长就跳过了[绕来绕去就像“你儿子是我儿子的爸爸一样头疼”],就做第四题.但是还有最后一个部分没写写好就到点了. 现在把它补充完整. ...
- 344. Reverse String(C++)
344. Reverse String Write a function that takes a string as input and returns the string reversed. E ...
- MVC 文本转换成html显示
最近在学习ASP.NET MVC,项目中需要将后台传输的HTML文本在前台页面显示:@Html.Raw(HttpUtility.HtmlDecode(ViewBag.DisplayText)).记下来 ...
- jQuery API中文文档
jQuery API中文文档 http://www.css88.com/jqapi-1.9/category/events/event-handler-attachment/ jQuery UI AP ...
- IOS开发备忘
1. ios 真机调试时出现CopyPngFile error解决方法 说是读取的时候没有找到这张图片,检查了一下图片路径,没有问题,于是google之,找到两种解决方法 : 方法一:在build s ...
- 再次探究Android ListView缓存机制
概述 虽然现在5.0后Google推出了RecycleView,但在5.0 Lollipop普及前Listview仍会被广泛使用,所以打算再次探究一下Listview的源码,了解一下Listview ...
- phalapi
public为程序入口 Demo和MyApp为具体的实现 public为多入口 demo和myapp都是入口,但是进入后即又为单入口 list为接口文档,是自动解析程序里的注释自动生成的文档 框架执行 ...
- Egret HTTP网络
HTTP 请求与响应: private createGameScene():void { //HTTP 1.0 var request = new egret.HttpRequest(); reque ...