当前位置:网站首页>pytest 与 unittest 的区别
pytest 与 unittest 的区别
2022-08-09 13:06:00 【沉觞流年】
pytest 与 unittest 的区别
1、表达用例:
- unittest 通过定义一个类,继承unittest.TestCase
- pytest 直接定义类 / 函数
2、断言的表达:
- unittest:self.assertxxx()
- pytest:assert 表达式(结果为True-断言成功,结果为False-断言失败)
3、收集用例:
- unittest:TestLoader类+TestSuite类,discover收集用例
- pytest:自动收集用例
4、fixture:前置后置
- unittest:setUp&tearDown 继承至setUpClass&tearDownClass
- pytest:function(用例)→ class(测试类)→ Module(.py文件) → Session(会话)
5、插件
- unittest:无
- pytest:插件数量700+。如html插件、allure报告
边栏推荐
猜你喜欢
FFmpeg多媒体文件处理(ffmpeg操作目录及list的实现)
Unicom network management protocol block diagram
音频基础学习——声音的本质、术语与特性
乐东消防救援大队应邀为干部开展消防安全培训
GIN文件上传与返回
[极客大挑战 2019]Upload
WSA toolkit installed app store tip doesn't work how to solve?
RobotFramework 之 Setup和Teardown
Ledong Fire Rescue Brigade was invited to carry out fire safety training for cadres
puzzle(016.5)逻辑电路
随机推荐
ARM board adds routing function
WSA toolkit installed app store tip doesn't work how to solve?
kustomize entry example and basic syntax instructions
NFS pays special attention to the problem of permissions
NC161 二叉树的中序遍历
Unicom network management protocol block diagram
Q_06_02 类型模型
telnet+ftp to control and upgrade the device
剑指 Offer 57 - II. 和为s的连续正数序列(滑动窗口)
现在40系显卡都快出来了,为何1060型号的显卡还有这么多人用?
Professor Chen Qiang's "Machine Learning and R Application" course Chapter 15 Homework
[FPGA Tutorial Case 48] Image Case 8 - Realization of Converting RGB Image to HSV Image Based on FPGA, Assisted Verification by MATLAB
Deep Learning Based on R Language - Simple Regression Case
Periodic sharing of Alibaba Da Tao system model governance
PO、DO、TO、VO、DO、DTO、DAO、POJO都是什么?
【NVIDIA】Tesla V100安装NVIDIA-Driver驱动程序适配CUDA-Toolkit-11.6
5G China unicom AP:B SMS ASCII Transcoding Requirements
Unity3d_API_GPS_LocationService
客户端连接rtsp的步骤
GIN Bind mode to get parameters and form validation