当前位置:首页>python>基于python的测试框架01-Pytest

基于python的测试框架01-Pytest

  • 2026-07-02 12:26:56
基于python的测试框架01-Pytest
0、前言

上节我们介绍了pytest的命名规则、运行方式及分组机制,本节将继续介绍用例跳过、前后置处理等。

1、测试用例跳过

在测试过程中,难免会遇到有些用例不需要执行,如功能尚未实现、依赖的环境不满足(如操作系统、python版本)、某个已知问题导致的用例失败需暂时屏蔽;

    • 无条件跳过(skip)

    无条件跳过,即无论什么情况下,该用例都不执行。当待测系统的某些功能未实现时可用该手段进行跳过。

    ##test_calculator.pyimport pytestclass TestCalculator:    """测试计算器功能"""    def test_add(self):        """测试加法"""        assert 2+2==4    def test_subtract(self):        """测试减法"""        assert 4-2==2def test_multiply():    assert 2*3==6@pytest.mark.skip(reason="功能未能实现")def test_divide():    assert 6/3==2#命令行终端输入:pytest -vs test_calculator.py即可运行
    • 有条件跳过(skipif)

    当用例比较依赖测试环境,但我们的环境又不满足对应要求时,我们可使用该手段进行跳过该用例,如用例对python版本及操作系统存在限制。

    ##test_calculator.pyimport pytestimport sysclass TestCalculator:    """测试计算器功能"""    def test_add(self):        """测试加法"""        assert 2+2==4    def test_subtract(self):        """测试减法"""        assert 4-2==2#如该用例仅支持在3.11版本及以上python中运行@pytest.mark.skipif(sys.version_info<(3,11),reason="需要3.11版本及以上的python")def test_multiply():    assert 2*3==6#如该用例仅支持在为win32的系统中运行@pytest.mark.skipif(sys.platform == "win32", reason="Windows 环境暂不支持")def test_divide():    assert 6/3==2#命令行终端输入:pytest -vs test_calculator.py即可运行
    • 预期失败(xfail)

    当某条用例为已知问题且处于待修复状态时,可使用 @pytest.mark.xfail 将其标记为预期失败。该用例仍会正常执行,但断言失败时不会被计入失败统计,结果显示为 XFAIL(预期失败)。注意:若标记为xfail的用例意外执行成功,结果则显示为 XPASS(意外通过),标识该问题可能已被修复,并且可以考虑移除标记。

    ##test_calculator.pyimport pytestclass TestCalculator:    """测试计算器功能"""    def test_add(self):        """测试加法"""        assert 2+2==4    def test_subtract(self):        """测试减法"""        assert 4-2==2def test_multiply():    assert 2*3==6@pytest.mark.xfail(reason="预期失败")def test_divide():    assert 6/3==3#命令行终端输入:pytest -vs test_calculator.py即可运行

    2、前后置处理

    自动化测试中,很多测试用例都需要执行相同的准备工作和清理工作,如接口测试中,每个用例执行前要登录、执行后要退出。如果每个用例都重复写一遍登录和退出代码,不仅冗余,而且难以维护。pytest为我们提供了很好的处理办法——fixture。本节我们利用Python制作一个简单的虚拟ECU,并基于此展开实践。

    ## virtual_ecu.pyclass VirtualEcu:    """虚拟ECU,模仿UDS诊断服务"""    def __init__(self):        # 会话状态:默认会话模式        self.session_mode="default"        # DID数据模拟        self.did_data={            0xF192:b"1HGCM82633A123456",#VIN码            0xF193:b"1.00.01" #版本信息        }        self.dtc_response=(            b'\x59\x02\x09\x01\x23\x45\x09\x01\x23\x46\x09'        )    def handle(self,request:bytes)->bytes:        """        处理UDS请求,返回响应        """        sid=request[0]        # 10服务:诊断会话控制        if sid == 0x10:            sub_func=request[1]            if sub_func == 0x01# 默认会话                self.session_mode = "default"                return b"\x50\x01"            if sub_func == 0x03:                self.session_mode="extended"                return b"\x50\x03"            return b"\x7F\x10\x12"           # 子功能不支持        # 22服务:读DID        if sid == 0x22:            did= (request[1]<<8)|request[2]            if did in self.did_data:                return b"\x62"+request[1:3]+self.did_data[did]            return b"\x7F\x22\x31" # 请求超出范围        # 19 服务:读故障码        if sid==0x19:            sub_func=request[1]            if sub_func == 0x02:                return self.dtc_response            return b"\x7F\x19\x12" # 子功能不支持        return b"\x7F"+bytes([sid])+b"\x11" #服务不支持
    • scope参数

    scope参数用于控制fixture的生命周期,即决定fixture在多久范围内共享一个实例。其共有四类取值:function(默认,每个测试函数执行一次)、class(每个测试类执行一次)、module(每个.py文件执行一次)、session(整个测试会话执行一次,所有的测试文件),接下来我们依次给出各类取值的相应表现。

    #test_ecu.pyimport pytestfrom virtual_ecu import VirtualEcu@pytest.fixture(scope="function")##@pytest.fixture(scope="class")##@pytest.fixture(scope="module")def ecu():    """前置:创建虚拟 ECU 实例"""    print("\n🚗 [前置] 启动虚拟 ECU")    ecu_object = VirtualEcu()    yield ecu_objectshang    print("🚗 [后置] 关闭虚拟 ECU")class TestDid:    def test_read_vin(self,ecu):        """测试读取 VIN"""        resp = ecu.handle(b"\x22\xF1\x92")        assert resp[:3] == b"\x62\xF1\x92"        print(f"📋 VIN: {resp[3:].decode()}")    def test_read_version(self,ecu):        """测试读取version"""        resp=ecu.handle(b"\x22\xF1\x93")        assert resp[:3]==b"\x62\xF1\x93"        print(f"👀Version:{resp[3:].decode()}")class TestDtc:    """读取对应的DTC"""    def test_read_dtc(self,ecu):        resp=ecu.handle(b"\x19\x02\x09")        assert resp[:2]==b"\x59\x02"        print(f"📋 DTC:{resp[3:].hex()}")## 命令行输入pytest -vs ./test_ecu.py
    执行上述代码,可以发现当参数为function时,fixture中的前后置处理在每个测试方法中都会独立创建和销毁,共创建 4 次;当参数为class时,fixture中的前后置处理在每个测试类中各运行一次;当参数为module时,可以发现fixture中的前后置处理会在fixture的.py文件中统一执行一次前后处理;当参数为session且同一次运行中包含多个测试文件时,会发现所有文件中执行一次fixture中前后置处理,单文件运行时,效果和module参数的效果一致。
    • autouse参数
    autouse参数是fixture的一个参数,默认值为False。当设置为Ture时,fixture会自动生效,无需在测试函数中进行显式声明,给出以下示例。
    #demo.pyimport pytestimport time@pytest.fixture(autouse=True)##@pytest.fixture(autouse=False)def time_use():    time_start=time.time()    print(f"[前置]条件处理")    yield  #测试用例开始执行    time_end=time.time()    print(f"\n[后置]本次测试用例执行耗时{time_end-time_start:.4f}秒")def test_ecu01():    print(f"---正在执行 test_ecu01---")    time.sleep(3)    print(f"---test_ecu01 执行完毕---")def test_ecu02():    print(f"---正在执行 test_ecu02---")    time.sleep(3)    print(f"---test_ecu02 执行完毕---")## 命令行输入pytest -vs ./demo.py
    执行上述代码后,可以发现当autouse=True时,,每个测试函数自动执行前后置,无需任何参数;当autouse=False时,测试函数在参数中引用 fixture,否则前后置不会执行。
    • name参数

    name参数的作用是给fixture起别名,这样可以在测试函数中可以用便捷的名字去替代前后值处理函数的原名,格式如下。
    @pytest.fixture(name='new_name')
    注意:一旦使用该参数更换别名后,原函数的名称就失效了,测试函数只能使用别名进行引用。
    • params参数

    params参数用于让同一个fixture返回多组不同的数据,每组数据会自动生成一个独立的测试用例。在运行过程中,依赖pytest 内置的request fixture 来获取当前参数值——request.param为params参数中当前正在处理的值。params支持列表、元组、字典等类型。此外,params使用时可搭配ids参数,该参数是用于给params生成的测试用例起一个可读的名称,让测试输出更加直观。
    ##test_ecu.pyimport pytestfrom virtual_ecu import VirtualEcu@pytest.fixture()def ecu():    """前置:创建虚拟 ECU 实例"""    print("\n🚗 [前置] 启动虚拟 ECU")    ecu_object = VirtualEcu()    yield ecu_object    print("🚗 [后置] 关闭虚拟 ECU")@pytest.fixture(params=[0xF192,0xF193],ids=["VIN","VERSION"])def did(request):    return request.paramclass TestDid:    def test_read_vin(self,ecu,did):        """测试读取 VIN"""        test_did=b"\x22"+bytes([did >> 8, did & 0xFF]) # DID 拆成两个字节的字节串        resp = ecu.handle(test_did)        assert resp[:3] == b"\x62"+test_did[1:3]        print(f"📋 诊断结果: {resp[3:].decode()}")## 命令行输入pytest -vs ./test_ecu.py
    通过执行上述代码不难发现,我们利用params参数实现对两个DID测试,并利用ids参数使测试结果输出更加直观。
    ##无ids参数test_ecu.py::TestDid::test_read_vin[61842]##有ids参数 test_ecu.py::TestDid::test_read_vin[VIN]
    除了上述的参数化方式外,我们还可以利用@pytest.mark.parametrize来进行参数化表达,使用该方式和fixture的参数化有异曲同工之妙,但是其直接参数化测试函数,适合单个测试函数独立参数化,而fixture参数化适合多个测试函数共享同一组参数
    ##test_ecu.pyimport pytestfrom virtual_ecu import VirtualEcu@pytest.fixture()def ecu():    """前置:创建虚拟 ECU 实例"""    print("\n🚗 [前置] 启动虚拟 ECU")    ecu_object = VirtualEcu()    yield ecu_object    print("🚗 [后置] 关闭虚拟 ECU")#@pytest.mark.parametrize(args_name,args_value) args_name:参数名称;args_value:参数值@pytest.mark.parametrize("did",(0xF192,0xF193))class TestDid:    def test_read_vin(self,ecu,did):        """测试读取 VIN"""        test_did=b"\x22"+bytes([did >> 8, did & 0xFF]) # DID 拆成两个字节的字节串        resp = ecu.handle(test_did)        assert resp[:3] == b"\x62"+test_did[1:3]        print(f"📋 诊断结果: {resp[3:].decode()}")## 命令行输入pytest -vs ./test_ecu.py

    3、conftest.py文件

    conftest.py文件是pytest中的一个特殊文件,用来存放”共享的fixture“,即同目录以及子目录下的所有测试文件都可以使用该文件中的fixture,并且无需导入,pytest会自动发现该文件。
    ##conftest.pyimport pytestfrom virtual_ecu import VirtualEcu@pytest.fixture()def ecu():    """前置:创建虚拟 ECU 实例"""    print("\n🚗 [前置] 启动虚拟 ECU")    ecu_object = VirtualEcu()    yield ecu_object    print("🚗 [后置] 关闭虚拟 ECU")@pytest.fixture(params=[0xF192,0xF193],ids=["VIN","VERSION"])def did(request):    return request.param

    4、总结

    本节简要介绍了pytest的用例跳过、前后置处理等操作。后续我们将在此基础上进一步对整个自动化测试框架介绍与剖析。谢谢大家能读到这里,祝愿大家工作顺利,天天开心✌!

    最新文章

    随机文章

    基本 文件 流程 错误 SQL 调试
    1. 请求信息 : 2026-07-04 00:13:38 HTTP/2.0 GET : https://f.mffb.com.cn/a/491293.html
    2. 运行时间 : 0.262597s [ 吞吐率:3.81req/s ] 内存消耗:4,470.03kb 文件加载:140
    3. 缓存信息 : 0 reads,0 writes
    4. 会话信息 : SESSION_ID=1b3e164cedac2311a7cb5a38fb793798
    1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
    2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
    3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
    4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
    5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
    6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
    7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
    8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
    9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
    10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
    11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
    12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
    13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
    14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
    15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
    16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
    17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
    18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
    19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
    20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
    21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
    22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
    23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
    24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
    25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
    26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
    27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
    28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
    29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
    30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
    31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
    32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
    33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
    34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
    35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
    36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
    37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
    38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
    39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
    40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
    41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
    42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
    43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
    44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
    45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
    46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
    47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
    48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
    49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
    50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
    51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
    52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
    53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
    54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
    55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
    56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
    57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
    58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
    59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
    60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
    61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
    62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
    63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
    64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
    65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
    66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
    67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
    68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
    69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
    70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
    71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
    72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
    73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
    74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
    75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
    76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
    77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
    78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
    79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
    80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
    81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
    82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
    83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
    84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
    85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
    86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
    87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
    88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
    89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
    90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
    91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
    92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
    93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
    94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
    95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
    96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
    97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
    98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
    99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
    100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
    101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
    102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
    103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
    104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
    105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
    106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
    107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
    108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
    109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
    110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
    111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
    112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
    113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
    114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
    115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
    116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
    117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
    118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
    119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
    120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
    121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
    122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
    123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
    124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
    125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
    126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
    127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
    128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
    129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
    130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
    131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
    132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
    133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
    134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
    135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
    136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
    137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
    138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
    139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
    140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
    1. CONNECT:[ UseTime:0.001154s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
    2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001455s ]
    3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000937s ]
    4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.047520s ]
    5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001751s ]
    6. SELECT * FROM `set` [ RunTime:0.000806s ]
    7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001591s ]
    8. SELECT * FROM `article` WHERE `id` = 491293 LIMIT 1 [ RunTime:0.024782s ]
    9. UPDATE `article` SET `lasttime` = 1783095218 WHERE `id` = 491293 [ RunTime:0.004130s ]
    10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.001056s ]
    11. SELECT * FROM `article` WHERE `id` < 491293 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001620s ]
    12. SELECT * FROM `article` WHERE `id` > 491293 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.003459s ]
    13. SELECT * FROM `article` WHERE `id` < 491293 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001866s ]
    14. SELECT * FROM `article` WHERE `id` < 491293 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.004557s ]
    15. SELECT * FROM `article` WHERE `id` < 491293 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000961s ]
    0.264218s