上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 65 下一页
摘要: #test_demo.pyimport allureimport pytestclass TestDemo: @allure.feature('比较功能') @allure.story('1等于1') def test_compare_numbers(self): expected = 1 actu 阅读全文
posted @ 2023-07-20 19:24 胖豆芽 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 在pycharm中下载 allure-pytest包 解决办法: pip install allure-pytest 坑: 解释报错原因:使用的命令不对 pip install allure 报错 没有这个allure包 阅读全文
posted @ 2023-07-20 18:02 胖豆芽 阅读(256) 评论(0) 推荐(0) 编辑
摘要: dict10={'a':'aa','b':'bb','c':'cc'} new_dict={'a':'a','b':'b'} dict10.update(new_dict)# updata 可以新增或者修改字典 print(dict10) ''' {'a': 'a', 'b': 'b', 'c': 阅读全文
posted @ 2023-07-20 12:27 胖豆芽 阅读(6) 评论(0) 推荐(0) 编辑
摘要: import pytest class Test1: def test1(self): assert 1 == 1 assert 2 + 2 == 4 assert 3 + 3 == 6 if __name__=='__main__': pytest.main([__file__]) ''' tes 阅读全文
posted @ 2023-07-19 21:55 胖豆芽 阅读(10) 评论(0) 推荐(0) 编辑
摘要: # 导入随机数包 import random # 第一个类 动物类 class Animal: # 定义属性 def __init__(self,animal,weight,call,food): self._animal=animal self._weight=weight self._call= 阅读全文
posted @ 2023-07-19 18:35 胖豆芽 阅读(2) 评论(0) 推荐(0) 编辑
摘要: import random # 动物类 class Animal: def __init__(self, animal_type, weight, cries, food): self._animal_type = animal_type self._weight = weight self._cr 阅读全文
posted @ 2023-07-18 22:11 胖豆芽 阅读(3) 评论(0) 推荐(0) 编辑
摘要: import random# 动物类class Animal: def __init__(self, animal_type, weight, cries, food): self._animal_type = animal_type self._weight = weight self._crie 阅读全文
posted @ 2023-07-18 17:59 胖豆芽 阅读(1) 评论(0) 推荐(0) 编辑
摘要: # 目标获取10个房间里的动物 和体重 import random class Room: def __init__(self,roomnum,animal_type): # 房间号 self._roomnum=roomnum # 动物 self._animal_type=animal_type # 阅读全文
posted @ 2023-07-17 21:48 胖豆芽 阅读(17) 评论(0) 推荐(0) 编辑
摘要: from loguru import logger logger.debug("异常") logger.info("异常") logger.warning("异常") logger.error("异常") logger.critical("异常") # 对日志做配置 放在指定的文件夹 当超过200K 阅读全文
posted @ 2023-07-17 21:47 胖豆芽 阅读(16) 评论(0) 推荐(0) 编辑
摘要: try: # num=int(input("请输入数字:")) # print(1/num) age= int(input("请输入年龄,不要小于18岁:")) if age < 18: # 非python的异常,业务逻辑上的异常,主动异常 raise raise NameError('异常,年纪小 阅读全文
posted @ 2023-07-17 19:25 胖豆芽 阅读(5) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 65 下一页