上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页
摘要: 详解闭包和装饰器: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 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 装饰器: 定义:decorator,在代码运行期间为函数动态增加功能 注意:decorator本质上是一个返回函数的高阶函数;decorator总是接收一个函数作为参数,并返回一个函数 举例: 1 # 获取函数执行时间 2 3 def getcosttime(func): 4 @functools. 阅读全文
posted @ 2021-06-15 16:46 _titleInfo 阅读(44) 评论(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 阅读(40) 评论(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 阅读(46) 评论(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 阅读(66) 评论(0) 推荐(0) 编辑
摘要: setup/deardown: 缺点:只能在单py文件内生效,没有全局设置,而且不支持单独对某一个方法配置。不支持返回值操作。 优点:有后置处理操作。单py文件内可以做到全局配置。 fixture: 缺点:不支持后置处理(fixture前置可通过autouse=True实现,后置可通过yield实现 阅读全文
posted @ 2021-05-20 16:24 _titleInfo 阅读(648) 评论(0) 推荐(0) 编辑
摘要: 1.pip install allure-pytest 2.执行时pytest xx.py --alluredir ./reportdir,会在该目录下生产reportdir文件夹存储测试报告 3.转化测试报告:allure server report 阅读全文
posted @ 2021-04-16 17:09 _titleInfo 阅读(58) 评论(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 阅读(361) 评论(0) 推荐(0) 编辑
摘要: 1.使用多个条件组合查询://*/div[@class='' and @id = ''] 2.使用container包含://*/span[contains(@class,'xxxxxxxxxxxxx') and @title=''] 解释:span标签的class包含了"xxxxxxxxxxx"则 阅读全文
posted @ 2021-04-16 11:37 _titleInfo 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 1.str="10条数据" 输入: str=str[:-3] print(str) 输出:str=10 2.str="共10条数据" 输入: str=str[1:-3] print(str) 输出:str=10 3.“共165条数据,每页10条,一共多少页?” 输入:165//10+1页 //:取整 阅读全文
posted @ 2021-03-25 20:00 _titleInfo 阅读(44) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页
//雪花飘落效果