python学习笔记:unittest单元测试】的更多相关文章

一.UnitTest基本使用 1. UnitTest框架 1.1 什么是框架 说明: 框架英文单词frame 为解决一类事情的功能集合 1.2什么是UnitTest框架 概念:UnitTest是python自带的一个单元测试框架,用它来做单元测试 1.3为什么使用UnitTest框架? 能够阻止多个用例去执行 提供丰富的断言方法 能够生成测试报告 1.4 UnitTest框架及原理 做过自动化测试的同学应该都知道python中的unittest框架,它是python自带的一套测试框架,学习起来也…
Python学习笔记(十三): 模块 包 if name == main 软件目录结构规范 作业-ATM+购物商城程序 1. 模块 1. 模块导入方法 import 语句 import module1[, module2[,... moduleN] # 当我们使用import语句的时候,Python解释器通过自己的搜索路径(存在sys.path里)进行搜索 from-import 语句 from modname import name1[, name2[, ... nameN]] # 这个声明不…
python学习笔记整理 数据结构--字典 无序的 {键:值} 对集合 用于查询的方法 len(d) Return the number of items in the dictionary d. 返回元素个数 d[key] Return the item of d with key key. Raises a KeyError if key is not in the map. If a subclass of dict defines a method _missing_() and key…
前言 前面我简单介绍了Python的Hello World.看到有人问我搞搞Python的Web,一时兴起,就来试试看. 第一篇 VS2013中Python学习笔记[环境搭建] 简单介绍Python环境的搭建过程,以及Hello World的实现. 第二篇 VS2013中Python学习笔记[基础入门] 我简单学习使用了Python的几个基础的知识点. 第一个Web页面 第一步:首先打开VS2013开发工具 ,新建项目,选择Django Project模版. 修改项目名称,可以查看到项目的文件结…
个人总结: import module,module就是文件名,导入那个python文件 import package,package就是一个文件夹,导入的文件夹下有一个__init__.py的文件, __init__.py可以有两种形式, 一种是直接import多个模块,例如 import fibo import abc 另外一种是 __all__ = ["A","B"] python学习笔记之module && package python的mo…
python学习笔记(六) 文件夹遍历 1.递归遍历 import os allfile = [] def dirList(path): filelist = os.listdir(path) for filename in filelist: filepath=os.path.join(path,filename) if(os.path.isdir(filepath)): dirList(filepath) allfile.append(filepath) return allfile pri…
接上一节  python学习笔记--Django入门四 管理站点 设置字段可选 编辑Book模块在email字段上加上blank=True,指定email字段为可选,代码如下: class Author(models.Model): first_name = models.CharField(max_length=) last_name = models.CharField(max_length=) email = models.EmailField(blank=True ) 所有字段都默认bl…
经过这几天的折腾,经历了Django的各种报错,翻译的内容虽然不错,但是与实际的版本有差别,会出现各种奇葩的错误.现在终于找到了解决方法:查看英文原版内容:http://djangobook.com/ 加入你使用的是CentOS系统或者Mac,默认版本是2.X,请及时更新版本到3.X 书中是这么说的: You can see that, and Python to be installed. If your system . 对于没有经验的人来说,使用python2.7 ,这是一个陷阱! Dan…
python学习笔记(一)元组,序列,字典…
Pythoner | 你像从前一样的Python学习笔记 Pythoner…