当前位置:网站首页>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 ")边栏推荐
- Golang--map扩容机制(含源码)
- 代码技巧——Controller参数注解@RequestParam
- 华为MindSpore开源实习机试题
- Redis——大Key问题
- Functions of tensorrt
- Don't use the new WP collection. Don't use WordPress collection without update
- Sentinel rules persist to Nacos
- Pbootcms collection and warehousing tutorial quick collection release
- The Chinese word segmentation task is realized by using traditional methods (n-gram, HMM, etc.), neural network methods (CNN, LSTM, etc.) and pre training methods (Bert, etc.)
- CUDA user object
猜你喜欢

深入了解JUC并发(一)什么是JUC

Sentinel 阿里开源流量防护组件

Find the highest value of the current element Z-index of the page

pytest(2) mark功能

链表(线性结构)

华为MindSpore开源实习机试题
![Data science [viii]: SVD (I)](/img/cb/7bf066a656d49666985a865c3a1456.png)
Data science [viii]: SVD (I)

In depth understanding of JUC concurrency (II) concurrency theory

In depth understanding of JUC concurrency (I) what is JUC

Linear DP (split)
随机推荐
深入学习JVM底层(二):HotSpot虚拟机对象
浅谈三点建议为所有已经毕业和终将毕业的同学
介绍两款代码自动生成器,帮助提升工作效率
Redis - big key problem
MySQL的10大经典错误
CUDA中的线程层次
Idea announced a new default UI, which is too refreshing (including the application link)
Pbootcms collection and warehousing tutorial quick collection release
日期时间API详解
Top 10 classic MySQL errors
Sparse array (nonlinear structure)
深入学习JVM底层(三):垃圾回收器与内存分配策略
20201025 Visual Studio2019 QT5.14 信号和槽功能的使用
TensorRT中的循环
ModuleNotFoundError: No module named ‘jieba.analyse‘; ‘jieba‘ is not a package
链表(线性结构)
Codeforces Round #797 (Div. 3) A—E
Linked list (linear structure)
pytest(1) 用例收集规则
AWD学习