上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页

2021年6月17日

摘要: 插入数据,存在就更新,不存在就插入 insert into tablename (key1,key2,key3) values ('xxx','xxx','xxx') on conflict(key1) do update set key2 = 'yyy',key3 = 'yyy'; 修改表中的字段 阅读全文
posted @ 2021-06-17 10:13 _titleInfo 阅读(1954) 评论(0) 推荐(0)
 

2021年6月16日

摘要: 主要分为内连接、外连接。外连接又分left outer join、right outer join、full outer join。区别如下: INNER JOIN只返回同时存在于两张表的行数据,由于students表的class_id包含1,2,3,classes表的id包含1,2,3,4,所以, 阅读全文
posted @ 2021-06-16 14:38 _titleInfo 阅读(435) 评论(0) 推荐(0)
 

2021年6月15日

摘要: 详解闭包和装饰器:https://blog.csdn.net/ljt735029684/article/details/80703649 https://www.cnblogs.com/xiaotie/archive/2011/08/03/2126145.html https://www.liaox 阅读全文
posted @ 2021-06-15 20:17 _titleInfo 阅读(27) 评论(0) 推荐(0)
 
摘要: 装饰器: 定义:decorator,在代码运行期间为函数动态增加功能 注意:decorator本质上是一个返回函数的高阶函数;decorator总是接收一个函数作为参数,并返回一个函数 举例: 1 # 获取函数执行时间 2 3 def getcosttime(func): 4 @functools. 阅读全文
posted @ 2021-06-15 16:46 _titleInfo 阅读(47) 评论(0) 推荐(0)
 
摘要: map 用法:map(func,序列),作用:将func一一作用在序列的元素上,并返回一个序列 举例:map(func,[1,2,3])=[func(1),func(2),func(3)] reduce 用法:reduce(func,序列),作用:将func累计作用在序列上;注意:reduce中的f 阅读全文
posted @ 2021-06-15 16:39 _titleInfo 阅读(44) 评论(0) 推荐(0)
 
摘要: list1 = [1,2,3] list2 = [4,5,6] 列表推导:lx = [(l1,l2) for l1 in list1 for l2 in list2] 生成器表达式 gx = ((l1,l2) for l1 in list1 for l2 in list2) for g in gx: 阅读全文
posted @ 2021-06-15 16:23 _titleInfo 阅读(47) 评论(0) 推荐(0)
 
摘要: 写在前边: list和tuple都是有序的,取值方式如list[1],tuple[1]。 list列表,是一种可变序列 tuple元组,是一种不可变序列,初始化后就不能修改 dict和set都是无序的。 dict字典,等同于map。dict存储键值对,如dict1 = {"key":"value"} 阅读全文
posted @ 2021-06-15 16:07 _titleInfo 阅读(95) 评论(0) 推荐(0)
 

2021年5月20日

摘要: setup/deardown: 缺点:只能在单py文件内生效,没有全局设置,而且不支持单独对某一个方法配置。不支持返回值操作。 优点:有后置处理操作。单py文件内可以做到全局配置。 fixture: 缺点:不支持后置处理(fixture前置可通过autouse=True实现,后置可通过yield实现 阅读全文
posted @ 2021-05-20 16:24 _titleInfo 阅读(671) 评论(0) 推荐(0)
 

2021年4月16日

摘要: 1.pip install allure-pytest 2.执行时pytest xx.py --alluredir ./reportdir,会在该目录下生产reportdir文件夹存储测试报告 3.转化测试报告:allure server report 阅读全文
posted @ 2021-04-16 17:09 _titleInfo 阅读(63) 评论(0) 推荐(0)
 
摘要: 在命令行执行:pytest xx.py ,提示找不到另一个文件yy里的包 解决办法:在xx.py导包前加上以下两句: import sys from os.path import dirname sys.path.append(dirname(dirname(__file__))) 阅读全文
posted @ 2021-04-16 17:08 _titleInfo 阅读(369) 评论(0) 推荐(0)
 
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 17 下一页