pytest
weixin_43555427
这个作者很懒,什么都没留下…
展开
-
python使用smtplib发送pytest html测试报告
python使用smtplib发送pytest html测试报告用例执行用时间命名pytest生成的html报告将路径传入发送邮件的函数中if __name__=='__main__': date=time.strftime('%y%m%d%H%M%S') reptadd='./report/report'+date+'.html' pytest.main(['-s','test_basic.py','-n=2','--html='+reptadd]) sendmai原创 2020-09-06 12:42:03 · 465 阅读 · 0 评论 -
pytest执行测试用例生成html报告
pytest执行测试用例生成html报告创建测试用例import timeimport pytestdef test_01(): print("test 1 begin") assert 1==1 time.sleep(6) print("test 1 begin")def test_02(): print("test 2 begin") time.sleep(6) print("test 2 finish") assert 0 =原创 2020-09-04 23:40:21 · 719 阅读 · 0 评论 -
pytest多进程执行测试用例
pytest多进程执行测试用例创建待测用例import timeimport pytestdef test_01(): print("test 1 begin") assert 1==1 time.sleep(6) print("test 1 begin")def test_02(): print("test 2 begin") time.sleep(6) print("test 2 finish") assert 0 == 1原创 2020-09-04 23:28:07 · 1251 阅读 · 0 评论 -
使用pytest执行测试用例
使用pytest测试用例创建待测用例import pytestdef test_01(): print("test 1") assert 1==1def test_02(): print("test 2") assert 0==1 调用pytest测试用例if __name__=="__main__": pytest.main(['test_pytest.py'])执行结果============================= te原创 2020-09-04 23:16:36 · 546 阅读 · 0 评论