Skip to content

Commit c655b64

Browse files
tusharsadhwaniseifertm
authored andcommitted
Rename 'scope' to 'loop_scope' in error message
fix failing test Add changelog entry
1 parent 3f0fdfb commit c655b64

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

docs/reference/changelog.rst

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Changelog
55
0.25.0 (UNRELEASED)
66
===================
77
- Deprecated: Added warning when asyncio test requests async ``@pytest.fixture`` in strict mode. This will become an error in a future version of flake8-asyncio. `#979 <https://github.com/pytest-dev/pytest-asyncio/pull/979>`_
8+
- Updates the error message about `pytest.mark.asyncio`'s `scope` keyword argument to say `loop_scope` instead. `#1004 <https://github.com/pytest-dev/pytest-asyncio/pull/1004>`_
89

910
0.24.0 (2024-08-22)
1011
===================

pytest_asyncio/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ def _get_marked_loop_scope(asyncio_marker: Mark) -> _ScopeName:
10041004
if asyncio_marker.args or (
10051005
asyncio_marker.kwargs and set(asyncio_marker.kwargs) - {"loop_scope", "scope"}
10061006
):
1007-
raise ValueError("mark.asyncio accepts only a keyword argument 'scope'.")
1007+
raise ValueError("mark.asyncio accepts only a keyword argument 'loop_scope'.")
10081008
if "scope" in asyncio_marker.kwargs:
10091009
if "loop_scope" in asyncio_marker.kwargs:
10101010
raise pytest.UsageError(_DUPLICATE_LOOP_SCOPE_DEFINITION_ERROR)

tests/markers/test_invalid_arguments.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async def test_anything():
6262
result = pytester.runpytest_subprocess()
6363
result.assert_outcomes(errors=1)
6464
result.stdout.fnmatch_lines(
65-
["*ValueError: mark.asyncio accepts only a keyword argument 'scope'*"]
65+
["*ValueError: mark.asyncio accepts only a keyword argument 'loop_scope'*"]
6666
)
6767

6868

0 commit comments

Comments
 (0)