当前位置:网站首页>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'
边栏推荐
- BAIC bluevale: performance under pressure, extremely difficult period
- 网站源码整站下载 网站模板源代码下载
- 为什么一定要从DevOps走向BizDevOps?
- 全局过滤器(处理时间格式)
- Can servers bundled with flask be safely used in production- Is the server bundled with Flask safe to use in production?
- Can I choose to open an account on CICC securities? Is it safe?
- 我国蜂窝物联网用户已达 15.9 亿,年内有望超越移动电话用户
- MIT's latest paper, "the need for interpretable features: motivation and classification": building interpretability in the constituent elements of machine learning models
- Oracle和JSON的结合
- PHP realizes lottery function
猜你喜欢

NC | intestinal cells and lactic acid bacteria work together to prevent Candida infection

"Target detection" + "visual understanding" to realize the understanding and translation of the input image (with source code)

JS基础--数据类型

12 product management platforms that everyone is using

Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS

y48.第三章 Kubernetes从入门到精通 -- Pod的状态和探针(二一)

商城小程序源码开源版-可二开

Technology sharing | introduction to linkis parameters

The exclusive collection of China lunar exploration project is limited to sale!

Database experiment report (I)
随机推荐
持续交付-Pipeline入门
The exclusive collection of China lunar exploration project is limited to sale!
力扣(LeetCode)181. 超过经理收入的员工(2022.06.29)
12款大家都在用的產品管理平臺
Combination of Oracle and JSON
I'd like to know where I can open an account in Guangzhou? Is it safe to open an account online now?
When is testing not unit testing- When is a Test not a Unit-test?
[.net6] use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
MIT's latest paper, "the need for interpretable features: motivation and classification": building interpretability in the constituent elements of machine learning models
使用强大的DBPack处理分布式事务(PHP使用教程)
CVPR 2022 | Virtual Correspondence: Humans as a Cue for Extreme-View Geometry
CVPR 2022 | self enhanced unpaired image defogging based on density and depth decomposition
kubernetes之ingress探索实践
网站源码整站下载 网站模板源代码下载
"Target detection" + "visual understanding" to realize the understanding and translation of the input image (with source code)
编译调试Net6源码
为什么一定要从DevOps走向BizDevOps?
英特尔实验室公布集成光子学研究新进展
Intel Labs announces new progress in integrated photonics research
Prism journal navigation button usability exploration record