Skip to content

Commit

Permalink
Add asyncio_default_fixture_loop_scope = "function" option
Browse files Browse the repository at this point in the history
`pytest-asyncio` has deprecated not providing a value for the
`asyncio_default_fixture_loop_scope` option. This commit adds a default
value of `"function"` for this option, as it was the previous default,
in the `pyproject.toml` files of this and all the generated projects.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
  • Loading branch information
llucax committed Oct 1, 2024
1 parent 22e8d3c commit 64ec94b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* API projects don't include the `google-common-protos` dependency by default.
* API projects updated the `grpcio` dependency to `1.66.1`.
* API projects updated the `frequenz-api-common` dependency to `0.6`.
* Added a new default option `asyncio_default_fixture_loop_scope = "function"` for `pytest-asyncio` as not providing a value is deprecated.

## Bug Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ disable = [
{%- if cookiecutter.type != "api" %}
testpaths = ["tests", "src"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
required_plugins = ["pytest-asyncio", "pytest-mock"]
{%- else %}
testpaths = ["pytests"]
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ ignore_missing_imports = true

[tool.pytest.ini_options]
testpaths = ["src", "tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
markers = [
"integration: integration tests (deselect with '-m \"not integration\"')",
"cookiecutter: integration tests (deselect with '-m \"not cookiecutter\"')",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ disable = [
[tool.pytest.ini_options]
testpaths = ["tests", "src"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
required_plugins = ["pytest-asyncio", "pytest-mock"]

[tool.mypy]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ disable = [
[tool.pytest.ini_options]
testpaths = ["tests", "src"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
required_plugins = ["pytest-asyncio", "pytest-mock"]

[tool.mypy]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ disable = [
[tool.pytest.ini_options]
testpaths = ["tests", "src"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
required_plugins = ["pytest-asyncio", "pytest-mock"]

[tool.mypy]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ disable = [
[tool.pytest.ini_options]
testpaths = ["tests", "src"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
required_plugins = ["pytest-asyncio", "pytest-mock"]

[tool.mypy]
Expand Down

0 comments on commit 64ec94b

Please sign in to comment.