Skip to content

Commit 38fc032

Browse files
authored
Bump to pytest 7.2.0 (pytest-dev#438)
* refactor: Address deprecation of @pytest.mark.tryfirst. Signed-off-by: Michael Seifert <[email protected]> * 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 <[email protected]> * build: Bump pytest to v7.2.0. Signed-off-by: Michael Seifert <[email protected]> Signed-off-by: Michael Seifert <[email protected]>
1 parent 28ba705 commit 38fc032

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

CHANGELOG.rst

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Changelog
33
=========
44

5+
UNRELEASED
6+
=================
7+
- Replaced usage of deprecated ``@pytest.mark.tryfirst`` with ``@pytest.hookimpl(tryfirst=True)`` `#438 <https://github.com/pytest-dev/pytest-asyncio/pull/438>`_
8+
59
0.20.1 (22-10-21)
610
=================
711
- 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>`_

dependencies/default/constraints.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
async-generator==1.10
22
attrs==22.1.0
33
coverage==6.5.0
4+
exceptiongroup==1.0.0
45
flaky==3.7.0
56
hypothesis==6.56.4
67
idna==3.4
@@ -11,9 +12,8 @@ mypy-extensions==0.4.3
1112
outcome==1.2.0
1213
packaging==21.3
1314
pluggy==1.0.0
14-
py==1.11.0
1515
pyparsing==3.0.9
16-
pytest==7.1.3
16+
pytest==7.2.0
1717
pytest-trio==0.7.0
1818
sniffio==1.3.0
1919
sortedcontainers==2.4.0

pytest_asyncio/plugin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def pytest_configure(config: Config) -> None:
180180
)
181181

182182

183-
@pytest.mark.tryfirst
183+
@pytest.hookimpl(tryfirst=True)
184184
def pytest_report_header(config: Config) -> List[str]:
185185
"""Add asyncio config to pytest header."""
186186
mode = _get_asyncio_mode(config)
@@ -299,7 +299,7 @@ async def setup() -> _R:
299299
_HOLDER: Set[FixtureDef] = set()
300300

301301

302-
@pytest.mark.tryfirst
302+
@pytest.hookimpl(tryfirst=True)
303303
def pytest_pycollect_makeitem(
304304
collector: Union[pytest.Module, pytest.Class], name: str, obj: object
305305
) -> Union[

tests/test_simple.py

-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ async def test_no_warning_on_skip():
240240

241241
def test_async_close_loop(event_loop):
242242
event_loop.close()
243-
return "ok"
244243

245244

246245
def test_warn_asyncio_marker_for_regular_func(testdir):

0 commit comments

Comments
 (0)