Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin: Use pytest 5.4.0 new Function API #142

Merged
merged 1 commit into from Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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