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
相关推荐
pitepa15 分钟前
安装 PyCharm
ide·python·pycharm
喜欢新新子17 分钟前
pycharm 中文字体报错
ide·python·pycharm
RunsenLIu23 分钟前
基于Flask前后端分离智慧安防小区系统
后端·python·flask
dragon090735 分钟前
Python打卡day49!!!
开发语言·python
一个天蝎座 白勺 程序猿1 小时前
Python爬虫(53)Python爬虫数据清洗与分析实战:Pandas+Great Expectations构建可信数据管道
爬虫·python·pandas
hu_nil1 小时前
Python第七周作业
java·前端·python
秋水丶秋水1 小时前
电脑桌面太单调,用Python写一个桌面小宠物应用。
开发语言·python·宠物
alpszero1 小时前
使用VSCode开发Django指南
vscode·python·django·sqlite
大数据魔法师2 小时前
MongoDB(八) - MongoDB GridFS介绍及使用Python操作GridFS
数据库·python·mongodb
weixin_377634842 小时前
【python异步多线程】异步多线程爬虫代码示例
开发语言·爬虫·python