a.相等 (a==b)内容一样,类型一致 from init import * import unittest class Baidu_Title(Info): def test_baidu_title(self): print ...
下面是unittest模块的常用方法: assertEqual a, b a b assertNotEqual a, b a b assertTrue x bool x is True assertFalse x bool x is False assertIs a, b a is b . assertIsNot a, b a is not b . assertIsNone x x is None ...
2016-08-05 17:17 0 6439 推荐指数:
a.相等 (a==b)内容一样,类型一致 from init import * import unittest class Baidu_Title(Info): def test_baidu_title(self): print ...
assert语句用于代码检测并报警。 语法 例子 # -*- coding: utf-8 -*- # assert语句说明 a,b= 1,23 a == 2 assert b >=21 assert b <=22 结果 分析 ...
断言语句的格式 test是一个表达式,表达式求值为Fals时引发AssertionError异常,msg是可选的异常消息。 运行test_assert(-10)程序将抛出异常: Traceback (most recent call last): File "M:/project ...
如果有名为hrinfo的数据库就删除: 创建名为hrinfo的数据库 : 选择数据库: 创建名为PER ...
unittest常用的断言方法 1.assertEqual(self, first, second, msg=None) --判断两个参数相等:first == second 2.assertNotEqual(self, first, second, msg=None) --判断两个参数 ...
一、模块、包 什么是模块? 模块实质上就是一个python文件,它是用来组织代码的,意思就是说把python代码写到里面,文件名就是模块的名称,test.py test就是模块名称。 什么是包? 包,package本质就是一个文件夹,和文件夹不一样的是它有一个__init__.py文件,包 ...
浏览目录 re模块 collections 模块 time 模块 random 模块 os 模块 sys 模块 序列化模块 一、re模块 先看一道例题: 我们 ...
// 如果表达式=2 返回1 否则返回0(相当于三目运算)if(id_type=2,1,0) as ids //如果表达式成立,则返回 end_time 否则 返回 23333if(end_time ...