В файле conftest.py у меня есть следующие настройки:
Код: Выделить всё
@pytest.fixture
def input_payload_1() -> pydantic.BaseModel:
pass
@pytest.fixture
def input_payload_2() -> pydantic.BaseModel:
pass
Код: Выделить всё
@pytest.mark.parametrize(
"input_payload, expected_output",
[
("input_payload_1", {"value"}),
("input_payload_2", {"value2"}),
],
)
def test_something(input_payload, expected_output):
result = tested_functionality(input_payload)
assert result == expected_output
Подробнее здесь: https://stackoverflow.com/questions/790 ... ing-pytest
Мобильная версия