question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pytest-asyncio 0.17.0 compatibility

See original GitHub issue

Checklist

  • The bug is reproducible against the latest release or master.
  • There are no similar issues or pull requests to fix it yet.

Describe the bug

After upgrading pytest-asyncio to 0.17.0 the test suite errors out with a DeprecationWarning and requires asyncio_mode be set.

Steps to reproduce the bug

Upgrade pytest-asyncio==0.17.0

Expected behavior

Test suite should run.

Actual behavior

Test suite fails with DeprecationWarning

Debugging material

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/nix/store/4jkpympg0q96d3pz8pas80mr13w5jkv7-python3.9-pytest-6.2.5/lib/python3.9/site-packages/_pytest/main.py", line 265, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/nix/store/4jkpympg0q96d3pz8pas80mr13w5jkv7-python3.9-pytest-6.2.5/lib/python3.9/site-packages/_pytest/config/__init__.py", line 982, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/nix/store/dvzzxjq78w03crpj1n21lk3h704h7qq3-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "/nix/store/dvzzxjq78w03crpj1n21lk3h704h7qq3-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "/nix/store/dvzzxjq78w03crpj1n21lk3h704h7qq3-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/nix/store/dvzzxjq78w03crpj1n21lk3h704h7qq3-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/nix/store/dvzzxjq78w03crpj1n21lk3h704h7qq3-python3.9-pluggy-1.0.0/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/nix/store/54w5nwd2bhak3324ccg0inc1darcsjlm-python3.9-pytest-asyncio-0.17.0/lib/python3.9/site-packages/pytest_asyncio/plugin.py", line 112, in pytest_configure
INTERNALERROR>     config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)
INTERNALERROR>   File "/nix/store/4jkpympg0q96d3pz8pas80mr13w5jkv7-python3.9-pytest-6.2.5/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1321, in issue_config_time_warning
INTERNALERROR>     warnings.warn(warning, stacklevel=stacklevel)
INTERNALERROR> DeprecationWarning: The 'asyncio_mode' default value will change to 'strict' in future, please explicitly use 'asyncio_mode=strict' or 'asyncio_mode=auto' in pytest configuration file.

Environment

  • NixOS 22.05 (unstable)
  • Python 3.9.10
  • starlette 0.17.1
  • pytest 6.2.5
  • pytest-asyncio 0.17.0

Additional context

https://github.com/pytest-dev/pytest-asyncio/releases/tag/v0.17.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
aminalaeecommented, Jan 16, 2022

Well Starlette doesn’t use pytest-asyncio that’s why it’s surprising to see this.

0reactions
aminalaeecommented, Jan 16, 2022

No worries. Good to hear it’s resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pytest-asyncio - PyPI
Specifically, pytest-asyncio provides support for coroutines as test functions. This allows users to await code inside their tests.
Read more >
pytest-dev/pytest-asyncio v0.17.0a6 on GitHub - NewReleases.io
New release pytest-dev/pytest-asyncio version v0.17.0a6 pytest-asyncio 0.17.0a6 on ... This mode is used by default for the sake of backward compatibility,
Read more >
Pytest-asyncio: Pytest Support for Asyncio - Morioh
Starting from pytest-asyncio>=0.17 , three modes are provided: auto, strict and legacy (default). The mode can be set by asyncio_mode configuration option in ......
Read more >
pytest-asyncio - Python Package Health Analysis - Snyk
The python package pytest-asyncio was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >
Changelog — Schemathesis 3.17.5 documentation
3.13.9 - 2022-04-14 . Fixed. Compatibility with pytest-asyncio>=0.17.1 . ... Bump minimum required hypothesis-jsonschema version to 0.17.0 .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found