From 6397a2255e3e9ef858439b164018438a8106f454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20L=C3=A9tendart?= Date: Fri, 13 Mar 2020 14:34:30 +0100 Subject: [PATCH] plugin: Use pytest 5.4.0 new Function API --- pytest_asyncio/plugin.py | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pytest_asyncio/plugin.py b/pytest_asyncio/plugin.py index 64ec03de..3fcea6fc 100644 --- a/pytest_asyncio/plugin.py +++ b/pytest_asyncio/plugin.py @@ -36,13 +36,13 @@ def pytest_configure(config): def pytest_pycollect_makeitem(collector, name, obj): """A pytest hook to collect asyncio coroutines.""" if collector.funcnamefilter(name) and _is_coroutine(obj): - item = pytest.Function(name, parent=collector) + item = pytest.Function.from_parent(collector, name=name) # Due to how pytest test collection works, module-level pytestmarks # are applied after the collection step. Since this is the collection # step, we look ourselves. transfer_markers(obj, item.cls, item.module) - item = pytest.Function(name, parent=collector) # To reload keywords. + item = pytest.Function.from_parent(collector, name=name) # To reload keywords. if 'asyncio' in item.keywords: return list(collector._genfunctions(name, obj)) diff --git a/setup.py b/setup.py index 8d80b08e..18566bfa 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ def find_version(): "Framework :: Pytest", ], python_requires=">= 3.5", - install_requires=["pytest >= 3.6.0, < 5.4.0"], + install_requires=["pytest >= 5.4.0"], extras_require={ ':python_version == "3.5"': "async_generator >= 1.3", "testing": [