Skip to content

Commit 64ec94b

Browse files
committed
Add asyncio_default_fixture_loop_scope = "function" option
`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 <[email protected]>
1 parent 22e8d3c commit 64ec94b

File tree

7 files changed

+8
-0
lines changed

7 files changed

+8
-0
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* API projects don't include the `google-common-protos` dependency by default.
2323
* API projects updated the `grpcio` dependency to `1.66.1`.
2424
* API projects updated the `frequenz-api-common` dependency to `0.6`.
25+
* Added a new default option `asyncio_default_fixture_loop_scope = "function"` for `pytest-asyncio` as not providing a value is deprecated.
2526

2627
## Bug Fixes
2728

cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ disable = [
197197
{%- if cookiecutter.type != "api" %}
198198
testpaths = ["tests", "src"]
199199
asyncio_mode = "auto"
200+
asyncio_default_fixture_loop_scope = "function"
200201
required_plugins = ["pytest-asyncio", "pytest-mock"]
201202
{%- else %}
202203
testpaths = ["pytests"]

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ ignore_missing_imports = true
196196

197197
[tool.pytest.ini_options]
198198
testpaths = ["src", "tests"]
199+
asyncio_mode = "auto"
200+
asyncio_default_fixture_loop_scope = "function"
199201
markers = [
200202
"integration: integration tests (deselect with '-m \"not integration\"')",
201203
"cookiecutter: integration tests (deselect with '-m \"not cookiecutter\"')",

tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ disable = [
155155
[tool.pytest.ini_options]
156156
testpaths = ["tests", "src"]
157157
asyncio_mode = "auto"
158+
asyncio_default_fixture_loop_scope = "function"
158159
required_plugins = ["pytest-asyncio", "pytest-mock"]
159160

160161
[tool.mypy]

tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ disable = [
154154
[tool.pytest.ini_options]
155155
testpaths = ["tests", "src"]
156156
asyncio_mode = "auto"
157+
asyncio_default_fixture_loop_scope = "function"
157158
required_plugins = ["pytest-asyncio", "pytest-mock"]
158159

159160
[tool.mypy]

tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ disable = [
151151
[tool.pytest.ini_options]
152152
testpaths = ["tests", "src"]
153153
asyncio_mode = "auto"
154+
asyncio_default_fixture_loop_scope = "function"
154155
required_plugins = ["pytest-asyncio", "pytest-mock"]
155156

156157
[tool.mypy]

tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ disable = [
155155
[tool.pytest.ini_options]
156156
testpaths = ["tests", "src"]
157157
asyncio_mode = "auto"
158+
asyncio_default_fixture_loop_scope = "function"
158159
required_plugins = ["pytest-asyncio", "pytest-mock"]
159160

160161
[tool.mypy]

0 commit comments

Comments
 (0)