Skip to content

Commit 0adfc17

Browse files
authored
Add asyncio_default_fixture_loop_scope = "function" option (#318)
`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.
2 parents 5e5b14d + b243695 commit 0adfc17

File tree

6 files changed

+11
-5
lines changed

6 files changed

+11
-5
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* API projects updated the `frequenz-api-common` dependency to `0.6`.
2525
* Update the SDK dependency to `1.0.0rc901`.
2626
* Change `edit_uri` default branch to v0.x.x in mkdocs.yml.
27+
* Added a new default option `asyncio_default_fixture_loop_scope = "function"` for `pytest-asyncio` as not providing a value is deprecated.
2728

2829
## Bug Fixes
2930

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ dev-pytest = [
119119
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
120120
{%- if cookiecutter.type != "api" %}
121121
"pytest-mock == 3.14.0",
122-
"pytest-asyncio == 0.23.7",
122+
"pytest-asyncio == 0.24.0",
123123
"async-solipsism == 0.6",
124124
{%- endif %}
125125
]
@@ -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"]

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ dev-pytest = [
8282
"pylint == 3.2.5", # We need this to check for the examples
8383
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
8484
"pytest-mock == 3.14.0",
85-
"pytest-asyncio == 0.23.7",
85+
"pytest-asyncio == 0.24.0",
8686
"async-solipsism == 0.6",
8787
]
8888
dev = [
@@ -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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ dev-pytest = [
8181
"pylint == 3.2.5", # We need this to check for the examples
8282
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
8383
"pytest-mock == 3.14.0",
84-
"pytest-asyncio == 0.23.7",
84+
"pytest-asyncio == 0.24.0",
8585
"async-solipsism == 0.6",
8686
]
8787
dev = [
@@ -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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ dev-pytest = [
7878
"pylint == 3.2.5", # We need this to check for the examples
7979
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
8080
"pytest-mock == 3.14.0",
81-
"pytest-asyncio == 0.23.7",
81+
"pytest-asyncio == 0.24.0",
8282
"async-solipsism == 0.6",
8383
]
8484
dev = [
@@ -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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ dev-pytest = [
8282
"pylint == 3.2.5", # We need this to check for the examples
8383
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
8484
"pytest-mock == 3.14.0",
85-
"pytest-asyncio == 0.23.7",
85+
"pytest-asyncio == 0.24.0",
8686
"async-solipsism == 0.6",
8787
]
8888
dev = [
@@ -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)