Skip to content

Commit 6397a22

Browse files
Romain LétendartTinche
authored andcommitted
plugin: Use pytest 5.4.0 new Function API
1 parent 21a0f94 commit 6397a22

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pytest_asyncio/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ def pytest_configure(config):
3636
def pytest_pycollect_makeitem(collector, name, obj):
3737
"""A pytest hook to collect asyncio coroutines."""
3838
if collector.funcnamefilter(name) and _is_coroutine(obj):
39-
item = pytest.Function(name, parent=collector)
39+
item = pytest.Function.from_parent(collector, name=name)
4040

4141
# Due to how pytest test collection works, module-level pytestmarks
4242
# are applied after the collection step. Since this is the collection
4343
# step, we look ourselves.
4444
transfer_markers(obj, item.cls, item.module)
45-
item = pytest.Function(name, parent=collector) # To reload keywords.
45+
item = pytest.Function.from_parent(collector, name=name) # To reload keywords.
4646

4747
if 'asyncio' in item.keywords:
4848
return list(collector._genfunctions(name, obj))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def find_version():
4040
"Framework :: Pytest",
4141
],
4242
python_requires=">= 3.5",
43-
install_requires=["pytest >= 3.6.0, < 5.4.0"],
43+
install_requires=["pytest >= 5.4.0"],
4444
extras_require={
4545
':python_version == "3.5"': "async_generator >= 1.3",
4646
"testing": [

0 commit comments

Comments
 (0)