Skip to content

Commit 4bd8a3b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4437281 commit 4bd8a3b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

changelog.d/1189.added.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Raise a ``pytest.UsageError`` on invalid ``asyncio_default_fixture_loop_scope`` and ``asyncio_default_test_loop_scope`` configuration values. (`#1189 <https://github.com/pytest-dev/pytest-asyncio/pull/1189>`_)
1+
Raise a ``pytest.UsageError`` on invalid ``asyncio_default_fixture_loop_scope`` and ``asyncio_default_test_loop_scope`` configuration values. (`#1189 <https://github.com/pytest-dev/pytest-asyncio/pull/1189>`_)

pytest_asyncio/plugin.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,7 @@ def _validate_scope(scope: str | None, option_name: str) -> None:
242242

243243
def pytest_configure(config: Config) -> None:
244244
default_fixture_loop_scope = config.getini("asyncio_default_fixture_loop_scope")
245-
_validate_scope(
246-
default_fixture_loop_scope, "asyncio_default_fixture_loop_scope"
247-
)
245+
_validate_scope(default_fixture_loop_scope, "asyncio_default_fixture_loop_scope")
248246
if not default_fixture_loop_scope:
249247
warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
250248

tests/test_fixture_loop_scopes.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,10 @@ def test_invalid_default_fixture_loop_scope_raises_error(pytester: Pytester):
146146
"""
147147
)
148148
result = pytester.runpytest()
149-
result.stderr.fnmatch_lines([
150-
"ERROR: 'invalid_scope' is not a valid "
151-
"asyncio_default_fixture_loop_scope. Valid scopes are: "
152-
"function, class, module, package, session."
153-
])
149+
result.stderr.fnmatch_lines(
150+
[
151+
"ERROR: 'invalid_scope' is not a valid "
152+
"asyncio_default_fixture_loop_scope. Valid scopes are: "
153+
"function, class, module, package, session."
154+
]
155+
)

0 commit comments

Comments
 (0)