Skip to content

Commit 5079642

Browse files
seifertmTinche
authored andcommitted
refactor: Removed use of obsolete transfer_markers during test collection phase.
transfer_markers was removed in Pytest 4.1. The minimum required pytest version for pytest-asyncio is currently v5.4.0. That means that `transfer_markers` is always a no-op. Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
1 parent a6758a1 commit 5079642

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

pytest_asyncio/plugin.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@
77

88
import pytest
99

10-
try:
11-
from _pytest.python import transfer_markers
12-
except ImportError: # Pytest 4.1.0 removes the transfer_marker api (#104)
13-
14-
def transfer_markers(*args, **kwargs): # noqa
15-
"""Noop when over pytest 4.1.0"""
16-
pass
17-
18-
1910
from inspect import isasyncgenfunction
2011

2112

@@ -39,13 +30,6 @@ def pytest_pycollect_makeitem(collector, name, obj):
3930
"""A pytest hook to collect asyncio coroutines."""
4031
if collector.funcnamefilter(name) and _is_coroutine(obj):
4132
item = pytest.Function.from_parent(collector, name=name)
42-
43-
# Due to how pytest test collection works, module-level pytestmarks
44-
# are applied after the collection step. Since this is the collection
45-
# step, we look ourselves.
46-
transfer_markers(obj, item.cls, item.module)
47-
item = pytest.Function.from_parent(collector, name=name) # To reload keywords.
48-
4933
if "asyncio" in item.keywords:
5034
return list(collector._genfunctions(name, obj))
5135

0 commit comments

Comments
 (0)