20221127 Python 测试框架Pytest 自动化训练营1

PPT

学习路线

pytest 学习路线.xmind.zip (73.3 KB)

代码地址

用例文档

计算器测试用例.xlsx (13.4 KB)

课后调查

https://jinshuju.net/f/hRO6Xo

参考代码

image

被测代码:

"""被测代码 计算器 相加,相除功能"""
class Calculator:
    def add(self, a, b):

        if a > 99 or a < -99 or b > 99 or b < -99:
            print("请输入范围为【-99, 99】的整数或浮点数")
            return "参数大小超出范围"

        return a + b

    def div(self, a, b):
        if a > 99 or a < -99 or b > 99 or b < -99:
            print("请输入范围为【-99, 99】的整数或浮点数")
            return "参数大小超出范围"

        return a / b

测试代码:

from pytest_prac.src.calculator import Calculator


class TestCal:
    def test_add1(self):
        """测试相加功能P0用例"""
        # assert 2 == 1 + 1    nonono
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert 2 == calc.add(1,1)

练习内容

  • 题目:
    • 根据需求编写计算机器(加法)相应的测试用例(将P0 级别用例 和P1级别的有效边界值,与无效边界值用例完成 )
    • 在调用每个测试方法之前打印【开始计算】
    • 在调用测试方法之后打印【结束计算】
    • 调用完所有的测试用例最终print 输出【结束测试】
    • 为用例添加标签 add P0 P1

setup teardown 机制

课后作业

  • 将课上的11条用例实例参数化
  • 将用例分类
  • 打印测试日志
from pytest_prac.src.calculator import Calculator


class TestCal:
    def test_add1(self):
        """测试相加功能P0用例"""
        # assert 2 == 1 + 1    nonono
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert 2 == calc.add(1, 1)

    def test_add2(self):
        """测试相加功能P0用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert 0.01 == calc.add(-0.01, 0.02)


    def test_add3(self):
        """测试相加功能P0用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert 10.02 == calc.add(10, 0.02)


    def test_add4(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert 197.99== calc.add(98.99, 99)

    def test_add5(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert 197.99 == calc.add(99, 98.99)

    def test_add6(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert -197.99== calc.add(-98.99, -99)

    def test_add7(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert -197.99 == calc.add(-99, -98.99)

    def test_add8(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert "参数大小超出范围"== calc.add(99.01, 0)

    def test_add9(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert "参数大小超出范围" == calc.add(-99.01, -1)

    def test_add10(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert "参数大小超出范围"== calc.add(2, 99.01)

    def test_add11(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert "参数大小超出范围" == calc.add(1, -99.01)

    def test_add12(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        # assert "参数大小超出范围"== calc.add('文', 9.3)
        print(calc.add('文', 9.3))

    def test_add13(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert "参数大小超出范围" == calc.add(4, '字')

    def test_add14(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert "参数大小超出范围"== calc.add('nu', 0.2)

    def test_add15(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert "参数大小超出范围" == calc.add(30, 't')

    def test_add16(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert "参数大小超出范围"== calc.add('*&', 0.2)

    def test_add17(self):
        """测试相加功能P1用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert "参数大小超出范围" == calc.add(21.45, '@')

import pytest

from pytest_prac.src.calculator import Calculator


class TestCal:
    def teardown_class(self):
        print("结束测试")

    def setup(self):
        print("开始计算")

    def teardown(self):
        print("结束计算")

    @pytest.mark.P0
    @pytest.mark.add
    @pytest.mark.parametrize("a,b,c", [(1, 1, 2), (-0.01, 0.02, 0.01), (10, 0.02, 10.02)],
                             ids=["【正向】2个整数相加,结果计算正确",
                                  "【正向】2个浮点数相加,结果计算正确",
                                  "【正向】整数与浮点数相加,结果计算正确"])
    def test_add1(self, a, b, c):
        """测试相加功能P0用例"""
        # 第一步:创建Calculator计算器实例对象
        calc = Calculator()
        assert c == calc.add(a, b)

    @pytest.mark.P1
    @pytest.mark.add
    @pytest.mark.youxiao
    @pytest.mark.parametrize("a,b,c",
                             [(98.99, 99, 197.99), (99, 98.99, 197.99), (-98.99, -99, -197.99), (-99, -98.99, -197.99)],
                             ids=["【边界】有效边界值相加,结果计算正确1", "【边界】有效边界值相加,结果计算正确2",
                                  "【边界】有效边界值相加,结果计算正确3", "【边界】有效边界值相加,结果计算正确4"])
    def test_add2(self, a, b, c):
        """测试相加功能P1用例有效参数"""
        calc = Calculator()
        assert c == calc.add(a, b)

    @pytest.mark.P1
    @pytest.mark.add
    @pytest.mark.wuxiaonum
    @pytest.mark.parametrize("a,b", [(99.01, 0), (-99.01, -1), (2, 99.01), (1, -99.01)],
                             ids=["【边界】无效边界值相加,给出提示信息1", "【边界】无效边界值相加,给出提示信息2",
                                  "【边界】无效边界值相加,给出提示信息3", "【边界】无效边界值相加,给出提示信息4"])
    def test_add3(self, a, b):
        """测试相加功能P1用例无效参数"""
        calc = Calculator()
        assert "参数大小超出范围" == calc.add(a, b)
        # return calc.add(a,b)

    #
    # def get_w_s(num):
    #     xs = Decimal(str(num)).as_tuple()
    #     return abs(xs[2])
    @pytest.mark.P1
    @pytest.mark.add
    @pytest.mark.wuxiaoqita
    @pytest.mark.parametrize("a,b", [("文", 9.3), (4, "文"), ("nu", 0.2), (30, "t"), ("*&", 0.2), (21.45, "@")],
                             ids=["【类型】输入中文,给出提示信息1", "【类型】输入中文,给出提示信息2",
                                  "【类型】输入英文,给出提示信息1", "【类型】输入英文,给出提示信息2",
                                  "【类型】输入特殊字符,给出提示信息1", "【类型】输入特殊字符,给出提示信息2"])
    def test_add4(self, a, b):
        """测试相加功能P1用例无效参数"""
        calc = Calculator()
        try:
            assert "参数大小超出范围" == calc.add(a, b)
        except Exception as e:
            assert "参数大小超出范围" == e
        # return calc.add(a, b)

    @pytest.mark.P2
    @pytest.mark.add
    @pytest.mark.parametrize("a,b", [("", -3), (20.93, ""), (" ", 3.14), (-90, " ")],
                             ids=["【类型】输入为空,给出提示信息1", "【类型】输入为空,给出提示信息2",
                                  "【类型】输入空格,给出提示信息1", "【类型】输入空格,给出提示信息2"])
    def test_add5(self, a, b):
        """测试相加功能P1用例无效参数"""
        calc = Calculator()
        try:
            assert "参数大小超出范围" == calc.add(a, b)
        except Exception as e:
            assert "参数大小超出范围" == e
        # return calc.add(a, b)
from pytest_prac.src.caculator import Calculator
import pytest

class TestCal:
    @pytest.mark.p0
    def test_add1(self):
        """测试相加功能P0用例"""
        # assert 2 == 1 + 1    nonono
        # 第一步:创建Calculator计算器实例对象
        print('=====开始计算======')
        calc = Calculator()
        assert 2 == calc.add(1,1)
        print('=====结束计算=======')
    @pytest.mark.p0
    def test_add2(self):
        print('=====开始计算======')
        calc=Calculator()
        assert 0.01==calc.add(0.02,-0.01)
        print('=====结束计算======')
    @pytest.mark.p0
    def test_add3(self):
        print('=====开始计算======')
        calc=Calculator()
        assert 10.02==calc.add(10,0.02)
        print('=====结束计算======')

    @pytest.mark.p1
    def test_add4(self):
        print('=====开始计算======')
        calc = Calculator()
        assert 197.99 == calc.add(98.99, 99)
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add5(self):
        print('=====开始计算======')
        calc = Calculator()
        assert 197.99 == calc.add(99, 98.99)
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add6(self):
        print('=====开始计算======')
        calc = Calculator()
        assert -197.99 == calc.add(-98.99, -99)
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add7(self):
        print('=====开始计算======')
        calc = Calculator()
        assert -197.99 == calc.add(-99, -98.99)
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add8(self):
        print('=====开始计算======')
        calc = Calculator()
        assert 99.01 == calc.add(99.01, 0)
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add9(self):
        print('=====开始计算======')
        calc = Calculator()
        assert -100.01 == calc.add(-99.01, -1)
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add10(self):
        print('=====开始计算======')
        calc = Calculator()
        assert 101.01 == calc.add(2, 99.01)
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add11(self):
        print('=====开始计算======')
        calc = Calculator()
        assert -98.01 == calc.add(1, -99.01)
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add12(self):
        print('=====开始计算======')
        calc = Calculator()
        assert '输入类型有误' == calc.add('文', 9.3)
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add13(self):
        print('=====开始计算======')
        calc = Calculator()
        assert '输入类型有误' == calc.add(4, '字')
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add14(self):
        print('=====开始计算======')
        calc = Calculator()
        assert '输入类型有误' == calc.add('nu', 0.2)
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add15(self):
        print('=====开始计算======')
        calc = Calculator()
        assert '输入类型有误' == calc.add(30, 't')
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add16(self):
        print('=====开始计算======')
        calc = Calculator()
        assert '输入类型有误' == calc.add('*&', 0.2)
        print('=====结束计算======')
    @pytest.mark.p1
    def test_add17(self):
        print('=====开始计算======')
        calc = Calculator()
        assert '输入类型有误' == calc.add(21.45, '@')
        print('=====结束计算======')

import pytest
import logging
from python_666.src.calculator import Calculator

class TestDemo:
calc = Calculator()

def setup(self):
    logging.info("开始计算")

def teardown(self):
    logging.info("结束计算")

def teardown_class(self):
    logging.info("结束测试")

@pytest.mark.P0
@pytest.mark.parametrize("a,b,c", [(1, 1, 2),
                                   (-0.01, 0.02, 0.01),
                                   (10, 0.02, 10.02)])
def test_add_0(self, a, b, c):
    assert self.calc.add(a, b) == c
    logging.info(f"正向用例:{a}+{b}的结果是{self.calc.add(a, b)}")

@pytest.mark.P1
@pytest.mark.parametrize("a,b,c", [(98.99, 99, 197.99),
                                   (99, 98.99, 197.99),
                                   (-99, -98.99, -197.99),
                                   (-98.99, -99, -197.99)])
def test_add_1(self, a, b, c):
    assert self.calc.add(a, b) == c
    logging.info(f"正向用例:{a}+{b}的结果是{self.calc.add(a, b)}")

@pytest.mark.P1
@pytest.mark.parametrize("a,b", [(99.01, 0),
                                 (-99.01, 1),
                                 (2, 99.01),
                                 (1, -99.01)])
def test_add_2(self, a, b):
    assert self.calc.add(a, b) == "参数大小超出范围"
    logging.info(f"P1参数越域:{a}+{b}的结果是{self.calc.add(a, b)}")

@pytest.mark.P1
@pytest.mark.parametrize("a,b", [("文", 9.3),
                                 (4, "字"),
                                 ("nu", 0.2),
                                 (30, "t"),
                                 ("*&", 0.2),
                                 (21.45, "@")])
def test_add_3(self, a, b):
    try:
        self.calc.add(a, b)
    except TypeError as e:
        assert type(e) == TypeError
        logging.info(f"P1用例:'{a}'或'{b}'参数类型错误!")

@pytest.mark.P2
@pytest.mark.parametrize("a,b", [("", 20.93),
                                 (-3, ""),
                                 (" ", 3.14),
                                 (-90, " ")])
def test_add_4(self, a, b):
    try:
        self.calc.add(a, b)
    except TypeError as e:
        assert type(e) == TypeError
        logging.info(f"P2用例:参数'{a}','{b}'空格类型错误:")

#import Calculator as Calculator
#from pytest_prac.src.calculator import Calculator
import pytest

from pytest_prac.src.calculator import Calculator

“”“测试相加功能P0用例”""
class TestCal:
@pytest.mark.P0
@pytest.mark.add
def test_add1(self):
calc = Calculator()
print(“开始计算”)
print(“相加后的值为”, calc.add(1,1))
assert 2 ==calc.add(1,1)
print(“结束计算”)
@pytest.mark.P0
@pytest.mark.add
def test_add2(self):
calc = Calculator()
print(“开始计算”)
print(“相加后的值为”, calc.add(-0.01, 0.02))
assert 0.01 ==calc.add(-0.01,0.02)
print(“结束计算”)
@pytest.mark.P0
@pytest.mark.add
def test_add3(self):
calc = Calculator()
print(“开始计算”)
print(“相加后的值为”, calc.add(10, 0.02))
assert 10.02 ==calc.add(10,0.02)
print(“结束计算”)
“”“测试相加功能P1用例”""
class TestCal1:
@pytest.mark.P1
@pytest.mark.add
def test_add4(self):
calc = Calculator()
print(“开始计算”)
print(“相加后的值为”, calc.add(98.99, 99))
assert 197.99 == calc.add(98.99, 99)
print(“结束计算”)

@pytest.mark.P0
@pytest.mark.add
def test_add5(self):
    calc = Calculator()
    print("开始计算")
    print("相加后的值为", calc.add(99, 98.99))
    assert 197.99 == calc.add(99, 98.99)
    print("结束计算")

@pytest.mark.P0
@pytest.mark.add
def test_add6(self):
    calc = Calculator()
    print("开始计算")
    print("相加后的值为", calc.add(-98.99, -99))
    assert -197.99 == calc.add(-98.99, -99)
    print("结束计算")

@pytest.mark.P0
@pytest.mark.add
def test_add7(self):
    calc = Calculator()
    print("开始计算")
    print("相加后的值为", calc.add(-99, -98.99))
    assert -197.99 == calc.add(-99, -98.99)
    print("结束计算")

@pytest.mark.P0
@pytest.mark.add
def test_add8(self):
        calc = Calculator()
        print("开始计算")
        print("相加后的值为", calc.add(1, 1.0))

        assert 2.0 == calc.add(1, 1.0)
        print("结束计算")

@pytest.mark.P0
@pytest.mark.add
def test_add9(self):
    calc = Calculator()
    print("开始计算")
    print("相加后的值为", calc.add(99.01, 0))
    assert "参数大小超出范围" == calc.add(99.01, 0)
    print("结束计算")

@pytest.mark.P0
@pytest.mark.add
def test_add10(self):
    calc = Calculator()
    print("开始计算")
    print("相加后的值为", calc.add(-99.01, -1))
    assert "参数大小超出范围" == calc.add(-99.01, -1)
    print("结束计算")

@pytest.mark.P0
@pytest.mark.add
def test_add11(self):
    calc = Calculator()
    print("开始计算")
    print("相加后的值为", calc.add(2, 99.01))
    assert "参数大小超出范围" == calc.add(2, 99.01)
    print("结束计算")

@pytest.mark.P0
@pytest.mark.add
def test_add12(self):
    calc = Calculator()
    print("开始计算")
    print("相加后的值为", calc.add(1, -99.01))
    print("结束计算")
    assert "参数大小超出范围" == calc.add(1, -99.01)
    print("结束计算")

测试用例:

import allure
import pytest
from pytest_prac.data.data_load import *
from pytest_prac.src.calculator import Calculator

def teardown_module():
    print(">>>>>结束测试<<<<<<<")

class TestCal:
    def setup(self):
        print(">>>>>开始计算<<<<<<<")
        self.cal = Calculator()

    def teardown(self):
        print(">>>>>结束计算<<<<<<<")

    test_data = data_sort("int_normal")
    print(test_data)
    @pytest.mark.parametrize("a,b,expected", test_data)
    @pytest.mark.P0
    @pytest.mark.add
    def test_add_normal(self,a,b,expected):
        allure.attach(body=f"expected={expected},a={a},b={b}",name="断言日志",attachment_type=allure.attachment_type.TEXT)
        assert float(expected) == self.cal.add(float(a), float(b))

    test_data = data_sort("int_out")
    print(test_data)
    @pytest.mark.parametrize("a,b,expected", test_data)
    @pytest.mark.P1
    @pytest.mark.add
    def test_add_int_out(self,a,b,expected):
        allure.attach(body=f"expected={expected},a={a},b={b}", name="断言日志", attachment_type=allure.attachment_type.TEXT)
        assert float(expected) == self.cal.add(float(a), float(b))

    test_data = data_sort("str_out")
    print(test_data)
    @pytest.mark.parametrize("a,b,expected", test_data)
    @pytest.mark.P1
    @pytest.mark.add
    def test_add_str_out(self,a,b,expected):
        if expected != None:
            allure.attach(body=f"expected={expected},a={a},b={b}", name="断言日志",
                          attachment_type=allure.attachment_type.TEXT)
            assert self.cal.add(a, b) == '参数大小超出范围'
        else:
            # try:
            #     self.cal.add(a, b)
            # except Exception as e:
            #     assert type(e) == TypeError
            with pytest.raises(Exception) as e:
                self.cal.add(a, b)
                assert type(e) == TypeError

数据加载方法

def data_excel():
    excel_list = []
    excel= openpyxl.load_workbook("E:/python/pythonJY5Project/pytest_prac/data/data.xlsx")
    excel.active
    sheet = excel["data"]
    for rows in sheet["A1":"D22"]:
        row_list = []
        for cell in rows:
            row_list.append(cell.value)
        excel_list.append(row_list)
    return excel_list

def data_sort(level):
    # level等级支持类型:int_normal,int_out,str_out
    dates = []
    data_list = data_excel()
    if level == "int_normal":
        for i in data_list:
            if i[3] == level:
                dates.append(i[0:-1])
    elif level == "int_out":
        for i in data_list:
            if i[3] == level:
                dates.append(i[0:-1])
    elif level == "str_out":
        for i in data_list:
            if i[3] == level:
                dates.append(i[0:-1])
    else:
        print("输入的参数,不能匹配到对应的等级")
    return dates

计算器作业
pytest_prac.zip (103.6 KB)

#参数化,用例分类,打印日志
import logging
from pytest_prac.src.caculator import Calculator
import pytest
class TestCalc:
    def setup_class(self):
        print('======开始测试======')
    def teardown_class(self):
        print('=======测试结束======')
    def setup_method(self):
        print('开始计算')
    def teardown_method(self):
        print('结束计算')

    @pytest.mark.p0
    @pytest.mark.add
    @pytest.mark.parametrize("a,b,expect",[(1,1,2),(-0.01,0.02,0.01),(10,0.02,10.02)])
    def test_add1(self,a,b,expect):
        logging.info('这是p0级的有效用例')
        calc=Calculator()
        result=calc.add(a,b)
        assert expect==result
    @pytest.mark.p1
    @pytest.mark.validboundary
    @pytest.mark.add
    @pytest.mark.parametrize('a,b,expect',[(98.99,99,197.99),
    (99,98.99,197.99),(-98.99,-99,-197.99),(-99,-98.99,-197.99)])
    def test_add2(self,a,b,expect):
        logging.info('这是p1级的有效边界用例')
        calc=Calculator()
        result=calc.add(a,b)
        assert expect==result

    @pytest.mark.p1
    @pytest.mark.invalidboundary
    @pytest.mark.add
    @pytest.mark.parametrize('a,b,expect',[(99.01,0,'参数大小超出范围'),
    (-99.01,-1,'参数大小超出范围'),(2,99.01,'参数大小超出范围'),(1,-99.01,'参数大小超出范围')])
    def test_add3(self,a,b,expect):
        logging.info('这是p1级的无效边界用例')
        calc=Calculator()
        result=calc.add(a,b)
        assert expect==result

    @pytest.mark.p1
    @pytest.mark.type
    @pytest.mark.add
    @pytest.mark.parametrize('a,b',[('文',9.3),(4,'字'),('nu',0.2),(30,'t'),('*&',0.2),(21.5,'@')])
    def test_add4(self,a,b):
        logging.info('这是p1级的特殊类型用例')
        calc=Calculator()
        try:
            result=calc.add(a, b)
        except Exception as e:
            assert type(e)==TypeError

    @pytest.mark.p2
    @pytest.mark.type
    @pytest.mark.add
    @pytest.mark.parametrize('a,b', [('', 20.3), (-3, ''), ('', 3.14), (-90, '')])
    def test_add5(self, a, b):
        logging.info('这是p2级的为空类型用例')
        calc = Calculator()
        try:
            result = calc.add(a, b)
        except Exception as e:
            assert type(e) == TypeError

#输出到test.log文件下的的日志
2022-12-03 14:43:18[INFO] 这是p0级的有效用例 (test_pytestpractice.py:19)
2022-12-03 14:43:18[INFO] 这是p0级的有效用例 (test_pytestpractice.py:19)
2022-12-03 14:43:18[INFO] 这是p0级的有效用例 (test_pytestpractice.py:19)
2022-12-03 14:43:18[INFO] 这是p1级的有效边界用例 (test_pytestpractice.py:29)
2022-12-03 14:43:18[INFO] 这是p1级的有效边界用例 (test_pytestpractice.py:29)
2022-12-03 14:43:18[INFO] 这是p1级的有效边界用例 (test_pytestpractice.py:29)
2022-12-03 14:43:18[INFO] 这是p1级的有效边界用例 (test_pytestpractice.py:29)
2022-12-03 14:43:18[INFO] 这是p1级的无效边界用例 (test_pytestpractice.py:40)
2022-12-03 14:43:18[INFO] 这是p1级的无效边界用例 (test_pytestpractice.py:40)
2022-12-03 14:43:18[INFO] 这是p1级的无效边界用例 (test_pytestpractice.py:40)
2022-12-03 14:43:18[INFO] 这是p1级的无效边界用例 (test_pytestpractice.py:40)
2022-12-03 14:43:18[INFO] 这是p1级的特殊类型用例 (test_pytestpractice.py:50)
2022-12-03 14:43:18[INFO] 这是p1级的特殊类型用例 (test_pytestpractice.py:50)
2022-12-03 14:43:18[INFO] 这是p1级的特殊类型用例 (test_pytestpractice.py:50)
2022-12-03 14:43:18[INFO] 这是p1级的特殊类型用例 (test_pytestpractice.py:50)
2022-12-03 14:43:18[INFO] 这是p1级的特殊类型用例 (test_pytestpractice.py:50)
2022-12-03 14:43:18[INFO] 这是p1级的特殊类型用例 (test_pytestpractice.py:50)
2022-12-03 14:43:18[INFO] 这是p2级的为空类型用例 (test_pytestpractice.py:62)
2022-12-03 14:43:18[INFO] 这是p2级的为空类型用例 (test_pytestpractice.py:62)
2022-12-03 14:43:18[INFO] 这是p2级的为空类型用例 (test_pytestpractice.py:62)
2022-12-03 14:43:18[INFO] 这是p2级的为空类型用例 (test_pytestpractice.py:62)