当前位置:网站首页>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'
边栏推荐
- Handling distributed transactions with powerful dbpack (PHP tutorial)
- The idea runs with an error command line is too long Shorten command line for...
- 谷歌新论文-Minerva:用语言模型解决定量推理问题
- Oracle和JSON的结合
- Personal mall two open Xiaoyao B2C mall system source code - Commercial Version / group shopping discount seckill source code
- MIT最新论文《对可解释特征的需求:动机和分类》:在机器学习模型的组成元素中建立可解释性
- 金鱼哥RHCA回忆录:DO447使用Ansible与API通信--使用Ansible Tower API启动作业
- 获取键代码
- [AI information monthly] 350 + resources! All the information and trends that can't be missed in June are here! < Download attached >
- escape sequence
猜你喜欢
[AI information monthly] 350 + resources! All the information and trends that can't be missed in June are here! < Download attached >
TEMPEST HDMI泄漏接收 3
YoDA统一数据应用——融合计算在蚂蚁风险场景下的探索与实践
“目标检测”+“视觉理解”实现对输入图像的理解及翻译(附源代码)
Brief analysis of edgedb architecture
Node version manager NVM installation and switching
Website source code whole site download website template source code download
Harbor webhook从原理到构建
12 plateformes de gestion de produits utilisées par tout le monde
Database experiment report (II)
随机推荐
Can servers bundled with flask be safely used in production- Is the server bundled with Flask safe to use in production?
CVPR22 |CMT:CNN和Transformer的高效结合(开源)
LeetCode. One question of the day: offer II 091 Paint the house (DP problem)
LeetCode 438. 找到字符串中所有字母异位词__滑动窗口
Ask everyone in the group about the fact that the logminer scheme of flick Oracle CDC has been used to run stably in production
China's cellular Internet of things users have reached 1.59 billion, and are expected to surpass mobile phone users within this year
Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
12款大家都在用的產品管理平臺
TEMPEST HDMI泄漏接收 4
Paxos 入门
CVPR 2022 | Virtual Correspondence: Humans as a Cue for Extreme-View Geometry
Submission lottery - light application server essay solicitation activity (may) award announcement
Guys, how to export iceberg data to MySQL? What tools are there? Neither sqoop nor dataX
The exclusive collection of China lunar exploration project is limited to sale!
转义字符串
Spam filtering challenges
CPI教程-异步接口创建及使用
LeetCode. 515. Find the maximum value in each tree row___ BFS + DFS + BFS by layer
YoDA统一数据应用——融合计算在蚂蚁风险场景下的探索与实践
Applymiddleware principle