1、先安装pip install pytest 2、初始pytest以及断言 """ Author:Zhou Create_Date:2022年07月31日--20:51 Tool:PyCharm Software: PyCharm """ def test_one (): except1 = 1 actual1 = 1 assert except1 == actual1 def test_two (): e
1、先安装pip install pytest
2、初始pytest以及断言
"""Author:Zhou
Create_Date:2022年07月31日--20:51
Tool:PyCharm
Software: PyCharm
"""
def test_one():
except1 = 1
actual1 = 1
assert except1 == actual1
def test_two():
except2 = 1
actual2 = 2
assert except2 == actual2
"""断言了解"""
def test_three():
# 等于
assert 1 == 1
# 不等于
assert 1 != 2
# 大于
assert 2 > 1
# 小于等于
assert 1 <= 1
# 属于
assert 'a' in 'abc'
# 不属于
assert 'a' not in 'bc'
# 是
assert True is True
# 不是
assert False is not False