Skip to content

Commit

Permalink
plugin: Use pytest 5.4.0 new Function API
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain Létendart authored and Tinche committed Mar 31, 2020
1 parent 21a0f94 commit 6397a22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pytest_asyncio/plugin.py
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -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": [
Expand Down

0 comments on commit 6397a22

Please sign in to comment.