当前位置:网站首页>Pytest (1) case collection rules
Pytest (1) case collection rules
2022-07-02 06:33:00 【bthtth】
1\pytest Rules for collecting use cases
(1) pytest Automatic collection execution pytest -m On command , For all tests under the directory , as follows
a\ Collect on bth Test cases in the directory
b\ Collect on users Test cases in the directory
(2) collect test_*.py or *_test.py Test cases in . The file where the test case is located must be .py Files of type , The document should be in the form of test_ Begin or begin with test_ ending
(3) If the use case , Class test_ The beginning function will be recognized as untested case
(4) If the use case is in a class , The test class should be in Test start , Must be Test. The functions in the class should be in test_ start
# File name to test_ start test_study_pytest.py
# File name to _test ending study_pytest_test.py
# With test The starting function is identified as a test case
def test_case_1():
print( The first test case )
# Not to test_ start , Not recognized as a test case
def not_case():
pass
# With Test The beginning class is recognized as the test class
class Test_case:
# In the test class test_ Initial function The test case
def test_case_2(self):
print(" Second test case ")
def test_case_3(self):
print(" The third test case ")
# In test class , Don't to test_ start , Cannot be identified as a test case
def case(self):
print(" I am here Test_case in , But not test cases ")
边栏推荐
猜你喜欢
Decryption skills of encrypted compressed files
AWD学习
Learn about various joins in SQL and their differences
华为MindSpore开源实习机试题
20201002 VS 2019 QT5.14 开发的程序打包
找到页面当前元素z-index最高的数值
It is said that Kwai will pay for the Tiktok super fast version of the video? How can you miss this opportunity to collect wool?
深入了解JUC并发(一)什么是JUC
注解和反射详解以及运用
In depth understanding of JUC concurrency (II) concurrency theory
随机推荐
利用传统方法(N-gram,HMM等)、神经网络方法(CNN,LSTM等)和预训练方法(Bert等)的中文分词任务实现
In depth understanding of JUC concurrency (II) concurrency theory
稀疏数组(非线性结构)
DeprecationWarning: .ix is deprecated. Please use.loc for label based indexing or.iloc for positi
20201002 VS 2019 QT5.14 开发的程序打包
web自动化切换窗口时报错“list“ object is not callable
Flask-Migrate 检测不到db.string() 等长度变化
ShardingSphere-JDBC篇
Code skills - Controller Parameter annotation @requestparam
qq邮箱接收不到jenkins构建后使用email extension 发送的邮件(timestamp 或 auth.......)
计算属性普通函数写法 和 set get 写法
深入了解JUC并发(一)什么是JUC
IPv6 experiment and summary
深入学习JVM底层(三):垃圾回收器与内存分配策略
ModuleNotFoundError: No module named ‘jieba.analyse‘; ‘jieba‘ is not a package
Vector types and variables built in CUDA
FE - Eggjs 结合 Typeorm 出现连接不了数据库
TensorRT的数据格式定义详解
ctf-web之练习赛
LeetCode 78. subset