当前位置:网站首页>Unittest框架中测试用例编写规范以及如何运行测试用例
Unittest框架中测试用例编写规范以及如何运行测试用例
2022-07-01 11:07:00 【大田测试录】
1、编写规范
1)测试用例需要以test开头,而test后面的字符按照ASCII 码排序运行
2)测试用例必须写在继承了unittest.TestCase中的类中
2、运行方式
1)使用PyCharm内置的unittest 运行,不需要main函数
运行规则:
TestLoader加载测试用例时,是先根据文件路径加载,找到对应的模块,再找到对应的类去运行。
2)使用unittest.main运行,需要在右上角修改运行模式。
备注:想要修改运行用例的前缀可以通过下面的方式改变loader.py 文件中,把test修改为其他字符串
testMethodPrefix='test'
边栏推荐
- 2022年6月编程语言排行,第一名居然是它?!
- BAIC bluevale: performance under pressure, extremely difficult period
- 十年磨一剑:蚂蚁集团可观测性平台 AntMonitor 揭秘
- The idea runs with an error command line is too long Shorten command line for...
- 优雅地翻转数组
- How to get the maximum value of column two and regenerate the table when the SQL Server column one is the same
- TEMPEST HDMI泄漏接收 3
- Cvpr22 | CMT: efficient combination of CNN and transformer (open source)
- sdp 协议中的packetization-mode方式和三种流传输模式
- Face detection and recognition system based on mtcnn+facenet
猜你喜欢

The idea runs with an error command line is too long Shorten command line for...

Harbor webhook从原理到构建

数据库实验报告(二)

Sqlachemy common operations

Uncover the secrets of new products! Yadi Guanneng 3 multi product matrix to meet the travel needs of global users

12 product management platforms that everyone is using

Oracle和JSON的结合

CVPR 2022 | Virtual Correspondence: Humans as a Cue for Extreme-View Geometry

華為設備配置大型網絡WLAN基本業務

京东与腾讯续签合作:向腾讯发行A类股 价值最高达2.2亿美元
随机推荐
Ask everyone in the group about the fact that the logminer scheme of flick Oracle CDC has been used to run stably in production
Network security learning notes 01 network security foundation
Development overview of fund internationalization
Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched
Packet mode and three streaming modes in SDP protocol
Mobile hard drive reads but does not display drive letter
Web foundation of network security note 02
Value 1000 graduation project campus information publishing platform website source code
Oracle和JSON的結合
网站源码整站下载 网站模板源代码下载
《数据安全法》出台一周年,看哪四大变化来袭?
Is it safe to open a stock account online in 2022? Is there any danger?
The exclusive collection of China lunar exploration project is limited to sale!
Mysql的四个隔离级别是如何实现的 (简要)
LeetCode 438. Find all letter ectopic words in the string__ sliding window
田溯宁投的天润云上市:市值22亿港元 年利润下降75%
The idea runs with an error command line is too long Shorten command line for...
kubernetes之ingress探索实践
[encounter Django] - (II) database configuration
NC | 肠道细胞和乳酸菌共同作用来防止念珠菌感染