pytest-order:
@pytest.fixture
@pytest.mark.order(1)
def smtp_connection1():
print("smtp_connection1")
@pytest.fixture
@pytest.mark.order(2)
def smtp_connection2():
print("smtp_connection2")
def test_ehlo(smtp_connection, smtp_connection2):
print("test_ehlo")
# smtp_connection1
# smtp_connection2
# test_ehlo
Как зависимость:
@pytest.fixture
@pytest.mark.order(1)
def smtp_connection1():
print("smtp_connection1")
@pytest.fixture
@pytest.mark.order(2)
def smtp_connection2():
print("smtp_connection2")
def test_ehlo(smtp_connection1, smtp_connection2):
print("test_ehlo")
# smtp_connection1
# smtp_connection2
# test_ehlo