diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5c84b46e..34fe9c08 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,10 @@ Changelog ========= +UNRELEASED +================= +- Replaced usage of deprecated ``@pytest.mark.tryfirst`` with ``@pytest.hookimpl(tryfirst=True)`` `#438 `_ + 0.20.1 (22-10-21) ================= - Fixes an issue that warned about using an old version of pytest, even though the most recent version was installed. `#430 `_ diff --git a/dependencies/default/constraints.txt b/dependencies/default/constraints.txt index d8925ba9..b8cc7fc6 100644 --- a/dependencies/default/constraints.txt +++ b/dependencies/default/constraints.txt @@ -1,6 +1,7 @@ async-generator==1.10 attrs==22.1.0 coverage==6.5.0 +exceptiongroup==1.0.0 flaky==3.7.0 hypothesis==6.56.4 idna==3.4 @@ -11,9 +12,8 @@ mypy-extensions==0.4.3 outcome==1.2.0 packaging==21.3 pluggy==1.0.0 -py==1.11.0 pyparsing==3.0.9 -pytest==7.1.3 +pytest==7.2.0 pytest-trio==0.7.0 sniffio==1.3.0 sortedcontainers==2.4.0 diff --git a/pytest_asyncio/plugin.py b/pytest_asyncio/plugin.py index 3b7b2304..17268c9b 100644 --- a/pytest_asyncio/plugin.py +++ b/pytest_asyncio/plugin.py @@ -180,7 +180,7 @@ def pytest_configure(config: Config) -> None: ) -@pytest.mark.tryfirst +@pytest.hookimpl(tryfirst=True) def pytest_report_header(config: Config) -> List[str]: """Add asyncio config to pytest header.""" mode = _get_asyncio_mode(config) @@ -299,7 +299,7 @@ async def setup() -> _R: _HOLDER: Set[FixtureDef] = set() -@pytest.mark.tryfirst +@pytest.hookimpl(tryfirst=True) def pytest_pycollect_makeitem( collector: Union[pytest.Module, pytest.Class], name: str, obj: object ) -> Union[ diff --git a/tests/test_simple.py b/tests/test_simple.py index dc68d61e..7b87a7f4 100644 --- a/tests/test_simple.py +++ b/tests/test_simple.py @@ -240,7 +240,6 @@ async def test_no_warning_on_skip(): def test_async_close_loop(event_loop): event_loop.close() - return "ok" def test_warn_asyncio_marker_for_regular_func(testdir):