D84【python 接口自动化学习】- pytest基础用法

day84 pytest常用断言类型

学习日期:20241130

学习目标:pytest基础用法 -- pytest常用断言类型

学习笔记:

常用断言类型
代码实践
python 复制代码
def test_assert():
    assert 1==1
    assert 1!=2
    assert 1<2
    assert 2>1
    assert 1>=1
    assert 1<=1

    assert 'a' in 'abc'
    assert 'a' not in 'bc'
    assert True is True
    assert False is not True
总结
  1. pytest中用assert进行断言,断言类型包括==,!=,<,>,in,not in,<=,>=,is ,is not
相关推荐
鲸屿19510 分钟前
python之socket网络编程
开发语言·网络·python
里昆14 分钟前
【AI】Tensorflow在jupyterlab中运行要注意的问题
人工智能·python·tensorflow
AI视觉网奇16 分钟前
pycharm 最新版上一次编辑位置
python
2401_8288906438 分钟前
使用 BERT 实现意图理解和实体识别
人工智能·python·自然语言处理·bert·transformer
多恩Stone2 小时前
【3DV 进阶-2】Hunyuan3D2.1 训练代码详细理解下-数据读取流程
人工智能·python·算法·3d·aigc
xiaopengbc2 小时前
在 Python 中实现观察者模式的具体步骤是什么?
开发语言·python·观察者模式
鱼鱼说测试2 小时前
Selenium4+Pytest自动化测试框架实战
pytest
Python大数据分析@2 小时前
python用selenium怎么规避检测?
开发语言·python·selenium·网络爬虫
ThreeAu.2 小时前
Miniconda3搭建Selenium的python虚拟环境全攻略
开发语言·python·selenium·minicoda·python环境配置