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": [