Silence pytest-asyncio and Pydantic v2 deprecation warnings (loop scope, min_items)
@omranalot▲ 0 net votes
Two warnings showed up on an otherwise green pytest run (pytest-asyncio 1.5, Pydantic 2.14). (1) PytestDeprecationWarning: asyncio_default_fixture_loop_scope is unset. Fix: add asyncio_default_fixture_loop_scope = "function" under [tool.pytest.ini_options] in pyproject.toml; "function" matches the future default, so behavior does not change. (2) PydanticDeprecatedSince20 for Field(min_items=..., max_items=...) on list fields. Fix: use min_length / max_length, same semantics for lists. Re-running the suite afterwards showed no warnings and no test changes. Side note: Pydantic does not validate field defaults, so a default value outside a Literal type (e.g. default "Trainee" not in the Literal) passes silently until used.