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 几种常见的测试框架的更多相关文章

  1. Python几种常用的测试框架

    一.测试的常用规则 一个测试单元必须关注一个很小的功能函数,证明它是正确的: 每个测试单元必须是完全独立的,必须能单独运行.这样意味着每一个测试方法必须重新加载数据,执行完毕后做一些清理工作.通常通过 ...

  2. 基于Python的接口自动化-unittest测试框架和ddt数据驱动

    引言 在编写接口自动化用例时,我们一般针对一个接口建立一个.py文件,一条接口测试用例封装为一个函数(方法),但是在批量执行的过程中,如果其中一条出错,后面的用例就无法执行,还有在运行大量的接口测试用 ...

  3. python自动化测试学习笔记-9测试框架

    学习了这么久的python,我们已经可以自己搭建一个简单的测试和框架了,先从简单的开始,有时我们编写接口的测试用例会用excel进行编写,以下面的接口测试用例模板为例,进行编写:

  4. python几种常见的模块安装方法

    1. 在线安装 1.1 在命令提示符中运行 pip install package_name 指令  注:具体前置步骤和教程:http://www.cnblogs.com/jfl-xx/p/72895 ...

  5. Selenium(Python)页面对象+数据驱动测试框架

    整个工程的目录结构: 常用方法类: class SeleniumMethod(object): # 封装Selenium常用方法 def __init__(self, driver): self.dr ...

  6. Selenium3+python自动化014-自动化测试框架的作用

    1.能够有效组织和管理测试脚本 2.进行数据驱动或者关键字驱动的测试 3.将基础的测试代码进行封装,降低测试脚本编写的复杂性和重复性 4.提高测试脚本维护和修改的效率 5.自动执行测试脚本,并自动发布 ...

  7. python几种常见语法

    NO1.type自动匹配类型 name="zhangsan"age=18 print (type(name))#type自动匹配类型 print ("name:%s,ag ...

  8. python 几种常用测试框架

    测试的常用规则 一个测试单元必须关注一个很小的功能函数,证明它是正确的: 每个测试单元必须是完全独立的,必须能单独运行.这样意味着每一个测试方法必须重新加载数据,执行完毕后做一些清理工作.通常通过se ...

  9. 用 Python 测试框架简化测试

    用 Python 测试框架简化测试 摘要:本文将向您介绍了三种流行 Python 测试框架(zope.testing,py.test,nose)的基本特性,并讨论新一代的测试风格. 最近出现了行业级的 ...

随机推荐

  1. .net中使用JQuery Ajax判断用户名是否存在的方法

    //第一步:新建一个(*.aspx|*.html)Index.aspx页面 添加jquery 1 <html xmlns="http://www.w3.org/1999/xhtml&q ...

  2. oracle 的 startup,startup mount,startup nomount之间的区别

    startup,startup mount,startup nomount之间的区别   startup nomount选项:(读初始化参数文件,启动实例) startup nomount选项启动实例 ...

  3. 段落排版--对齐(text-aliagn)

    想为块状元素中的文本.图片设置居中样式吗?可以使用text-align样式代码,如下代码可实现文本居中显示.(那么什么是块状元素呢?后面会讲到呢~) h1{ text-align:center; } ...

  4. Codeforces 474F - Ant colony

    注意到每个区间生存下来的蚂蚁的长度等于区间的gcd 于是可以先预处理出区间的gcd 然后二分查找就好了 预处理gcd我这里用的是倍增法 总的时间复杂度O(NlogN) /* Cf 271F 倍增求区间 ...

  5. 【POJ3237】【树链剖分】Tree

    Description You are given a tree with N nodes. The tree’s nodes are numbered 1 through N and its edg ...

  6. [FindBugs分析记录]Redundant nullcheck of o,which is known to be non-null

    官网解释: This method contains a redundant check of a known non-null value against the constant null. 这种 ...

  7. javascript 函数声明问题

    (function(){ //运行正常 test1(); function test1() { console.log('123'); }; })() (function(){ //出错,test2未 ...

  8. Bootstrap_Javascript_按钮插件

    一 . 加载状态按钮 HTML: <button class="btnbtn-primary" data-loading-text="正在加载中,请稍等...&qu ...

  9. js以json形式提交数据,后台接受

    $("#savename").click(function(){ var fananname=$("#editname").val(); var jsonLis ...

  10. awk里的各种坑

    今天又遇到一个,一旦需要定义一个局部数组(awk通过把局部变量定义在函数参数列表来实现局部这一特征)那么这个数组可以正常的操作,但是无法对他取长度,一旦使用length(tempArr)会得到这么一个 ...