pytest (一) fixture 简单使用

import pytest

# fixture默认参数function
@pytest.fixture()
def begin():
  print('执行 test_a')

# 参数传入 begin
def test_b(begin):
  print('执行 test_b')
执行 begin
执行 test_b
posted @ 2025-03-17 21:42  アーニャ  阅读(22)  评论(0)    收藏  举报