The asyncio policy system is deprecated. The event_loop_policy fixture should be deprecated in favor of the pytest_asyncio_loop_factories hook. The deprecation is needed to inform users to migrate away from the fixture.
The goal of this task is that every user who reimplements event_loop_policy receives a DeprecationWarning. The warning message should state that the event_loop_policy fixture is deprecated and will be removed. It should also explain what functionality users should use instead (i.e. the pytest_asyncio_loop_factories hook).
Possible implementation
A similar mechanism was needed for the deprecation of the event_loop fixture. This has previously been implemented by setting an attribute on the original fixture definition provided by pytest-asyncio. This attribute was used to emit a warning during fixture setup. Consequently, every fixture definition that didn't set the attribute caused a warning to be emitted.
This is just one way of solving this and merely provided as a pointer
The asyncio policy system is deprecated. The event_loop_policy fixture should be deprecated in favor of the pytest_asyncio_loop_factories hook. The deprecation is needed to inform users to migrate away from the fixture.
The goal of this task is that every user who reimplements event_loop_policy receives a DeprecationWarning. The warning message should state that the event_loop_policy fixture is deprecated and will be removed. It should also explain what functionality users should use instead (i.e. the pytest_asyncio_loop_factories hook).
Possible implementation
A similar mechanism was needed for the deprecation of the event_loop fixture. This has previously been implemented by setting an attribute on the original fixture definition provided by pytest-asyncio. This attribute was used to emit a warning during fixture setup. Consequently, every fixture definition that didn't set the attribute caused a warning to be emitted.
This is just one way of solving this and merely provided as a pointer