上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 40 下一页
摘要: 用例运行级别 模块级(setup_module/teardown_module)开始于模块始末,全局的 函数级(setup_function/teardown_function)只对函数用例生效(不在类中) 类级(setup_class/teardown_class)只在类中前后运行一次(在类中) 阅读全文
posted @ 2021-11-12 10:29 暄总-tester 阅读(88) 评论(0) 推荐(0)
摘要: 运行用例总结 在第N个用例失败后,结束测试执行 pytest -x # 第x次失败,就停止测试 pytest --maxfail=2 # 出现2个失败就终止测试 指定测试模块 pytest test_mod.py 指定测试目录 pytest testing/ 通过关键字表达式过滤执行 pytest 阅读全文
posted @ 2021-11-12 10:26 暄总-tester 阅读(80) 评论(0) 推荐(0)
摘要: VMware16安装启动 右键启动[VMware-workstation-full-16.1.2-17966106] 在许可证文本框中输入任意一行: ZF3R0-FHED2-M80TY-8QYGC-NPKYF YF390-0HF8P-M81RQ-2DXQE-M2UT6 ZF71R-DMX85-08D 阅读全文
posted @ 2021-11-10 12:52 暄总-tester 阅读(160) 评论(0) 推荐(0)
摘要: #被测程序 创建calc.py文件 class Calc: def add(self,a,b): return a+b def sub(self,a,b): return a--b #预留缺陷 if __name__=='__main__': #调试 c=Calc() print(c.add(3,5 阅读全文
posted @ 2021-11-09 11:26 暄总-tester 阅读(158) 评论(0) 推荐(0)
摘要: 创建测试函数、测试类和测试方法 def 测试函数(): 测试代码 class 测试类名: def 测试方法名(self): 测试代码 # 测试函数和测试类可以一起使用 pytest测试用例的含义和规则 1)pytest测试用例即符合pytest规则的测试模块、测试函数、测试方法 2)测试模块test 阅读全文
posted @ 2021-11-09 10:02 暄总-tester 阅读(121) 评论(0) 推荐(0)
摘要: Pytest测试框架 pytest是python的一种单元测试框架,与python自带的unittest测试框架类似,但是比unittest框架使用起来更简洁,效率更高 Pytest主要特点 非常容易上手,入门简单,文档丰富,文档中有很多实例可以参考 能够支持简单的单元测试和复杂的功能测试 支持参数 阅读全文
posted @ 2021-11-09 09:48 暄总-tester 阅读(134) 评论(0) 推荐(0)
摘要: unittest搭建项目目录结构 casedata.py文件代码 import pandas from project_M1.common import log def read_cases(excel, columns=[]): # 读取excel用例中的指定列 excel = '../excel 阅读全文
posted @ 2021-11-08 01:09 暄总-tester 阅读(402) 评论(0) 推荐(0)
摘要: 给多人发邮件 导入模块 import smtplib from email.mime.text import MIMEText from email.utils import formataddr 登录邮箱 smtp=smtplib.SMTP('smtp.163.com',25) smtp.logi 阅读全文
posted @ 2021-11-08 00:24 暄总-tester 阅读(183) 评论(0) 推荐(0)
摘要: 发送1个附件 导入模块 import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.utils import formataddr 登录邮箱 阅读全文
posted @ 2021-11-08 00:18 暄总-tester 阅读(211) 评论(0) 推荐(0)
摘要: 发送HTML正文邮件 邮件正文中可以使用HTML标记 mail=MIMEText(mailbody, 'html', 'utf-8') 导入模块 import smtplib from email.mime.text import MIMEText from email.utils import f 阅读全文
posted @ 2021-11-08 00:16 暄总-tester 阅读(259) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 40 下一页