Skip to content

Commit

Permalink
Bump to pytest 7.2.0 (#438)
Browse files Browse the repository at this point in the history
* refactor: Address deprecation of @pytest.mark.tryfirst.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* test: Remove return value from test case.

Return values in tests are deprecated starting from pytest 7.2 and will result in a warning.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

* build: Bump pytest to v7.2.0.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
  • Loading branch information
seifertm committed Nov 10, 2022
1 parent 28ba705 commit 38fc032
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -2,6 +2,10 @@
Changelog
=========

UNRELEASED
=================
- Replaced usage of deprecated ``@pytest.mark.tryfirst`` with ``@pytest.hookimpl(tryfirst=True)`` `#438 <https://github.com/pytest-dev/pytest-asyncio/pull/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 <https://github.com/pytest-dev/pytest-asyncio/issues/430>`_
Expand Down
4 changes: 2 additions & 2 deletions 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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pytest_asyncio/plugin.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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[
Expand Down
1 change: 0 additions & 1 deletion tests/test_simple.py
Expand Up @@ -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):
Expand Down

0 comments on commit 38fc032

Please sign in to comment.