当前位置:网站首页>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'
边栏推荐
- LeetCode.515. 在每个树行中找最大值___逐一BFS+DFS+按层BFS
- Have the bosses ever done the operation of sink shunting and writing to Clickhouse or other databases.
- flutter path_ Provider: ^2.0.10 can get temporary directory
- The idea runs with an error command line is too long Shorten command line for...
- 选择在中金证券上炒股开户可以吗?安全吗?
- Prism journal navigation button usability exploration record
- The first anniversary of the data security law, which four major changes are coming?
- 网站源码整站下载 网站模板源代码下载
- Personal mall two open Xiaoyao B2C mall system source code - Commercial Version / group shopping discount seckill source code
- China's cellular Internet of things users have reached 1.59 billion, and are expected to surpass mobile phone users within this year
猜你喜欢

YoDA统一数据应用——融合计算在蚂蚁风险场景下的探索与实践

软件项目管理 9.2.软件项目配置管理过程

Value 1000 graduation project campus information publishing platform website source code

Spam filtering challenges

Mall applet source code open source version - two open

Website source code whole site download website template source code download

Handling distributed transactions with powerful dbpack (PHP tutorial)

JS基础--数据类型

. Net 5.0+ does not need to rely on third-party native implementation of scheduled tasks

Combinaison Oracle et json
随机推荐
Ten years of sharpening a sword: unveiling the secrets of ant group's observability platform antmonitor
华为设备配置大型网络WLAN基本业务
Oracle和JSON的结合
[AI information monthly] 350 + resources! All the information and trends that can't be missed in June are here! < Download attached >
Face detection and recognition system based on mtcnn+facenet
Uncover the secrets of new products! Yadi Guanneng 3 multi product matrix to meet the travel needs of global users
CVPR 2022 | Virtual Correspondence: Humans as a Cue for Extreme-View Geometry
Mutual conversion of pictures in fluent uint8list format and pictures in file format
Brief analysis of edgedb architecture
TEMPEST HDMI泄漏接收 5
Combination of Oracle and JSON
MySQL IN 和 NOT IN () 空列表报错
[.net6] use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
为什么一定要从DevOps走向BizDevOps?
[paper reading] trajectory guided control prediction for end to end autonomous driving: a simple yet strong Ba
Can servers bundled with flask be safely used in production- Is the server bundled with Flask safe to use in production?
Matplotlib data visualization Foundation
sdp 协议中的packetization-mode方式和三种流传输模式
Crawler (2) - requests (1) | deep parsing of requests module
"Target detection" + "visual understanding" to realize the understanding and translation of the input image (with source code)