AA
Size: a a a
AA
S
@pytest.fixture
def my_fixture():
def func(*args, **kwgs):
do_something(*args, **kwgs)
return func
def test(my_fixture):
my_fixture('hello', 'world')
MA
S
@pytest.fixture
def my_fixture():
resources = []
def func(*args, **kwgs):
resource = create_resource(*args, **kwgs)
resources.append(resource)
return resource
yield func
for resource in resources:
resourse.destroy()
def test(my_fixture):
res_1 = my_fixture(name='resourse-1')
res_2 = my_fixture(name='resourse-2')
assert res_1.name != res_2.name
MA
EK
S
MA
СБ
AA
AA
@pytest.fixture
def my_fixture():
def func(*args, **kwgs):
do_something(*args, **kwgs)
return func
def test(my_fixture):
my_fixture('hello', 'world')
MA
MA
AA
MA
MA
MA
@pytest.mark.my_func_args(a1, a2, a3)
a1, a2, a3 = request.node.get_closest_marker('my_func_args').args
MA
КР
MB