码迷,mamicode.com
首页 >  
搜索关键字:assert    ( 2161个结果
assert:断言
一、基本语法 assert expression1, ["," expression2] x, y = 1, 2 assert x == y, "not equal" # 等价于下面的语法: x, y = 1, 2 if __debug__ and not x == y: raise Asserti ...
分类:其他好文   时间:2020-07-03 21:34:40    阅读次数:50
Purity in My Programming: Functions in Go
原文连接 https://hackernoon.com/purity-in-my-programming-pure-functions-in-go-c21m3u2z 什么是纯函数 在程序设计中,若一个函数符合以下要求,则它可能被认为是纯函数: 此函數在相同的输入值時,需產生相同的輸出。 函數的輸出和 ...
分类:其他好文   时间:2020-07-02 22:02:58    阅读次数:50
决策变元选择_决策分支策略——文献学习SAT Solving with Reference Points
要点:使用DMRP algorithm (decision making with a reference point)在重启阶段为解决问题提供好的方向。 引文来自: Kottler S. (2010) SAT Solving with Reference Points. In: Strichman ...
分类:其他好文   时间:2020-06-30 20:42:54    阅读次数:56
IO复用之 select
#include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <assert.h> int main () { int keyboard; int ret,i; char c; ...
分类:其他好文   时间:2020-06-30 14:42:04    阅读次数:56
python常见报错信息!错误和异常!附带处理方法
作为 Python 初学者,在刚学习 Python 编程时,经常会看到一些报错信息。 Python 有两种错误很容易辨认:语法错误和异常。 Python assert(断言)用于判断一个表达式,在表达式条件为 false 的时候触发异常。 语法错误 Python 的语法错误或者称之为解析错,是初学者 ...
分类:编程语言   时间:2020-06-30 10:37:55    阅读次数:169
pytest框架
pytest框架规则 测试文件以test_开头或者以_test结尾 测试类以Test开头,并且不能带有init方法 测试函数以test_开头 断言使用assert pytest框架运行用例 运行单个文件 运行多个文件 运行整个目录 import pytest if __name__=="__main ...
分类:其他好文   时间:2020-06-27 20:33:41    阅读次数:75
unittest测试框架初识_01
#count_01.py class Count: def add(self,a,b): return a + b #testcase_01.py import unittest from count_01 import Count #1、必须创建测试类,且必须继承unittest.TestCase ...
分类:其他好文   时间:2020-06-27 00:31:09    阅读次数:78
TypeScript(05): 变量声明
变量是一种使用方便的占位符,用于引用计算机内存地址。我们可以把变量看做存储数据的容器。TypeScript 变量的命名规则:变量名称可以包含数字和字母。除了下划线 _ 和美元 $ 符号外,不能包含其他特殊字符,包括空格。变量名不能以数字开头。变量使用前必须先声明,我们可以使用 var 来声明变量。我... ...
分类:其他好文   时间:2020-06-25 23:33:14    阅读次数:61
debug技巧
print assert #优雅点,效果同print log日志:最强大 https://www.cnblogs.com/yyds/p/6901864.html import logging #允许指定记录信息的级别,有debug,info,warning,error等几个级别 LOG_FORMAT ...
分类:其他好文   时间:2020-06-25 19:21:49    阅读次数:57
unittest单元测试案例(一)
实现登陆功能的单元测试 验证参数有效性函数 def login_check(username, password): """ :param username: 登陆用户名 :param password: 登陆密码 :return: """ if 6 <= len(password) <= 18: ...
分类:其他好文   时间:2020-06-23 15:34:05    阅读次数:57
2161条   上一页 1 ... 6 7 8 9 10 ... 217 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!