Skip to content

Commit

Permalink
chore: set pytest-asyncio loop scope to function (#566)
Browse files Browse the repository at this point in the history
To resolve the deprecation warning:

```
warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
ready: 12/16 workers/home/vdusek/Projects/crawlee-python/.venv/lib/python3.12/site-packages/pytest_asyncio/plugin.py:208: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"
```
  • Loading branch information
vdusek authored Oct 4, 2024
1 parent 8780ca3 commit 1a02495
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ max-branches = 18

[tool.pytest.ini_options]
addopts = "-ra"
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"
timeout = 1200

Expand Down

0 comments on commit 1a02495

Please sign in to comment.