当前位置:网站首页>3.3 测试模块的命名规则
3.3 测试模块的命名规则
2022-06-11 21:46:00 【redrose2100】
这里所说的测试模块实际就是测试脚本的文件,以上在讲的时候测试文件一致命名为test_demo.py,在本章开始也没有说什么要用test_demo.py,反正就这么用着,用到这里就有必要来分析分析文件的命名规则了
在pytest中,测试模块的命名规则是以test_开头或者_test结尾的文件,默认认为是测试文件
同样,话不多说,这里还是先来几个例子,这里需要创建几个文件(https://gitee.com/redrose2100/pytest-demo/tree/master/ch03/ex_004)
test_demo.py文件代码如下
def test_demo():
print("in test_demo.py")
assert 1==1
demo_test.py文件代码如下:
def test_demo():
print<边栏推荐
- Implementation stack and queue
- Addition without addition, subtraction, multiplication, Division
- Customer information management software
- Endnotex9 introduction and basic tutorial instructions
- 238. product of arrays other than itself
- 自定义实现offsetof
- Matlab: 文件夹锁定问题的解决
- In the future, cloud expansion technology is expected to be selected as a specialized, special and new enterprise in Shanghai
- Go OS module
- JVM | virtual machine stack (local variable table; operand stack; dynamic link; method binding mechanism; method call; method return address)
猜你喜欢
随机推荐
华为设备配置HoVPN
科普 | NFT的类型有哪些(上)
R语言相关文章、文献整理合集(持续更新)
R language book learning 03 "in simple terms R language data analysis" - Chapter 12 support vector machine Chapter 13 neural network
Maze problem in C language
超标量处理器设计 姚永斌 第2章 Cache --2.4 小节摘录
不使用加减乘除做加法
每日一题 - 罗马数字转整数
R语言书籍学习03 《深入浅出R语言数据分析》-第十章 关联规则 第十一章 随机森林
Matlab: 文件夹锁定问题的解决
Look for leap years and see how many leap years I have had since I was born (I have had five)
The college entrance examination is over, and life has just begun. Suggestions from a 10-year veteran in the workplace
剑指Offer 29.顺时针打印矩阵
判断大小端存储两种办法
Conception du Processeur superscalaire Yao yongbin chapitre 2 cache - - sous - section 2.4 extrait
Custom implementation offsetof
相对完善的单例模式
Go encoding package
Flink error: multiple tasks are started, and only one task is executed
R language book learning 03 "in simple terms R language data analysis" - Chapter 10 association rules Chapter 11 random forest









