Skip to content

Upgrading pytest-asyncio 0.16 to 0.17

Breaking0.16.0 → 0.17.2Breaking2Platform8Deprecated2New19Changed18Fixed12Other5

BreakingUpgrade verdict

2 breaking changes and 8 platform requirement changes.

  • The forbid_global_loop option is no longer available.
  • The process pool fixture and its marker are gone, so tests using them must switch to another approach.
  • This version works on Python 3.7.
  • The plugin now works on Python 3.7.
Top 5 of 11 that need code or config changes

Python requirement changed in 0.17.0a3: >= 3.6 → >=3.7.

Breaking2
Removes the forbid_global_loop parameter.
forbid_global_loop
Removes the event_loop_process_pool fixture and pytest.mark.asyncio_process_pool marker.
event_loop_process_poolpytest.mark.asyncio_process_pool
Platform8
Adds Python 3.7 support.
Adds support for Python 3.7.
Drops support for Python versions before 3.5.
Drops support for Python 3.6.
Drops support for Python 3.7.
Drops support for Python 3.7.
Adds support for Python 3.7.
Adds support for Python 3.7.
Deprecated1
Legacy mode keeps pytest-asyncio<0.17 behavior and emits deprecation warnings suggesting auto or strict mode.
@pytest_asyncio.fixtureasyncio_mode

Generated by DepDelta from published Python source. Not mixed with prose notes.

  • added: export fixture
  • removed: function transfer_markers(*args, **kwargs)
  • changed: constructor FixtureStripper(fixturedef) → constructor FixtureStripper(fixturedef: FixtureDef) -> None
  • changed: function event_loop(request) → function event_loop(request: pytest.FixtureRequest) -> Iterator[asyncio.AbstractEventLoop]
  • changed: function pytest_configure(config) → function pytest_configure(config: Config) -> None
  • changed: function pytest_fixture_post_finalizer(fixturedef, request) → function pytest_fixture_post_finalizer(fixturedef: FixtureDef, request: SubRequest) -> None
  • changed: function pytest_fixture_setup(fixturedef, request) → function pytest_fixture_setup(fixturedef: FixtureDef, request: SubRequest) -> Optional[object]
  • changed: function pytest_pycollect_makeitem(collector, name, obj) → function pytest_pycollect_makeitem(collector: Union[pytest.Module, pytest.Class], name: str, obj: object) -> Union[None, pytest.Item, pytest.Collector, List[Union[pytest.Item, pytest.Collector]]]
  • changed: function pytest_pyfunc_call(pyfuncitem) → function pytest_pyfunc_call(pyfuncitem: pytest.Function) -> Optional[object]
  • changed: function pytest_runtest_setup(item) → function pytest_runtest_setup(item: pytest.Item) -> None
  • changed: function unused_tcp_port() → function unused_tcp_port() -> int
  • changed: function unused_tcp_port_factory() → function unused_tcp_port_factory() -> Callable[[], int]
  • changed: function wrap_in_sync(func, _loop) → function wrap_in_sync(func: Callable[..., Awaitable[Any]], _loop: asyncio.AbstractEventLoop)
  • changed: method FixtureStripper.add(name) → method FixtureStripper.add(name: str) -> None
  • changed: method FixtureStripper.get_and_strip_from(name, data_dict) → method FixtureStripper.get_and_strip_from(name: str, data_dict: Dict[str, _T]) -> _T
  • added: class Mode(str, enum.Enum)
  • added: field Mode.AUTO
  • added: field Mode.LEGACY
  • added: field Mode.STRICT
  • added: function fixture(fixture_function: FixtureFunction, *, scope: Union[_ScopeName, Callable[[str, Config], _ScopeName]]=…, params: Optional[Iterable[object]]=…, autouse: bool=…, ids: Optional[Union[Iterable[Union[None, str, float, int, bool]], Callable[[Any], Optional[object]]]]=…, name: Optional[str]=…) -> FixtureFunction | (fixture_function: None=…, *, scope: Union[_ScopeName, Callable[[str, Confi…
  • added: function pytest_addoption(parser: Parser, pluginmanager: PytestPluginManager) -> None
  • added: function pytest_report_header(config: Config) -> List[str]
  • added: function unused_udp_port() -> int
  • added: function unused_udp_port_factory() -> Callable[[], int]
  • added: variable ASYNCIO_MODE_HELP
  • added: variable Config
  • added: variable FactoryFixtureFunction
  • added: variable FixtureDef
  • added: variable FixtureFunction
  • added: variable FixtureFunctionMarker
  • added: variable LEGACY_ASYNCIO_FIXTURE
  • added: variable LEGACY_MODE
  • added: variable Parser
  • added: variable PytestPluginManager
  • added: variable SimpleFixtureFunction
  • added: variable SubRequest