当前位置:网站首页>Pytest interface automation test framework | control test case execution
Pytest interface automation test framework | control test case execution
2022-07-24 00:13:00 【COCOgsta】
Video source :B standing 《 Risking your life to upload !pytest Interface automation test framework ( From basic theory to project practice and secondary development ) Teaching video 【 software test 】》
Organize the teacher's course content and test notes while studying , And share it with you , Infringement is deleted , Thank you for your support !
Attach summary sticker :pytest Interface automation test framework | Summary _COCOgsta The blog of -CSDN Blog
In the N After a use case fails , End test execution
pytest --maxfail=2 # appear 2 Terminate the test if it fails
import pytest
# Failure
def test_fail01():
print(" The first failure ")
assert 1==2
def test_fail02():
print(" The second failure ")
assert 1 == 2
def test_hello():
print(" The third success ")
assert 1 == 1
if __name__ == '__main__':
pytest.main(["--maxfail=2", "test_fail2.py"])Found directly in pycharm In the implementation, it does not take effect , But it takes effect with the command line
PS D:\SynologyDrive\CodeLearning\WIN\pytest\base_used> pytest .\test_fail2.py --maxfail 2
======================================================================================================== test session starts ========================================================================================================
platform win32 -- Python 3.6.6, pytest-7.0.1, pluggy-1.0.0
rootdir: D:\SynologyDrive\CodeLearning\WIN\pytest\base_used
plugins: allure-pytest-2.9.45, forked-1.4.0, html-3.1.1, metadata-1.11.0, ordering-0.6, rerunfailures-10.2, xdist-2.5.0
collected 3 items
test_fail2.py FF
============================================================================================================= FAILURES ==============================================================================================================
____________________________________________________________________________________________________________ test_fail01 ____________________________________________________________________________________________________________
def test_fail01():
print(" The first failure ")
> assert 1==2
E assert 1 == 2
test_fail2.py:6: AssertionError
------------------------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------------------------
The first failure
____________________________________________________________________________________________________________ test_fail02 ____________________________________________________________________________________________________________
def test_fail02():
print(" The second failure ")
> assert 1 == 2
E assert 1 == 2
test_fail2.py:11: AssertionError
------------------------------------------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------------------------------------------
The second failure
====================================================================================================== short test summary info ======================================================================================================
FAILED test_fail2.py::test_fail01 - assert 1 == 2
FAILED test_fail2.py::test_fail02 - assert 1 == 2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 2 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================================================= 2 failed in 0.09s =========================================================================================================
PS D:\SynologyDrive\CodeLearning\WIN\pytest\base_used>
边栏推荐
- How to open an account and buy financial products with 6% income?
- [for loop if conditional statement] summary
- 【译】Go RPC 入门:Hello World
- Space shooting lesson 08: improved collision
- Multi table query_ External connection
- 473-82(40、662、31、98、189)
- My meeting of OA project (query)
- 单目标追踪——【相关滤波】MOSSE:Visual Object Tracking using Adaptive Correlation Filters
- [wechat Payment]
- JS learning notes -- bottom implementation of array method
猜你喜欢

Write all the code as soon as you change the test steps? Why not try yaml to realize data-driven?

复制客服微信号,前往微信添加,拨打电话

DGS file upload

【译】Go RPC 入门:Hello World

NGFW的Portal认证实验

Mysql database foundation

太空射击第08课: 改进的碰撞

Deep learning 9 basic concepts of feedforward neural networks

Nacos
![[translation] Introduction to go RPC: Hello World](/img/dd/7887f056bc031fe50253078dd355d0.png)
[translation] Introduction to go RPC: Hello World
随机推荐
docker搭建sonarqube,mysql5.7环境
Take stock of 10 new layer1 to prepare for the next bull market
[Android kotlin] property, getter and setter
What are blue-green deployment, Canary release and a/b test
My meeting of OA project (query)
深度学习之 9 前馈神经网络2:实现前馈神经网络,模型调优
IT基础英语
Try new methods
The world's smallest material ranking, Lingzi, Xianzi, quark
Error handling of DGS
Linked list - 206. Reverse linked list (this question is very important)
Sentinel link mode flow control failure solution
在原生终端实现类似 rz、sz 上传下载文件与目录的功能
473-82(40、662、31、98、189)
数据驱动之Excel读写
After openfeign sets circuitbreaker=true, feign's readtimeout expires
As a programmer, is there anything you want to say to the newcomer?
Input and output of ACM mode
C语言详解系列——函数的认识(2)如何使用函数实现交换两个整型变量的值
JS learning notes -- bottom implementation of array method