You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[feat] Deprecates the optional scope keyword argument of asyncio markers. Users are encouraged to use the loop_scope keyword argument. The loop_scope kwarg does exactly the same, though its naming is consistent with the loop_scope kwarg of pytest_asyncio.fixture.
Copy file name to clipboardExpand all lines: docs/source/concepts.rst
+1-1
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ You may notice that the individual levels resemble the possible `scopes of a pyt
32
32
Pytest-asyncio provides one asyncio event loop for each pytest collector.
33
33
By default, each test runs in the event loop provided by the *Function* collector, i.e. tests use the loop with the narrowest scope.
34
34
This gives the highest level of isolation between tests.
35
-
If two or more tests share a common ancestor collector, the tests can be configured to run in their ancestor's loop by passing the appropriate *scope* keyword argument to the *asyncio* mark.
35
+
If two or more tests share a common ancestor collector, the tests can be configured to run in their ancestor's loop by passing the appropriate *loop_scope* keyword argument to the *asyncio* mark.
36
36
For example, the following two tests use the asyncio event loop provided by the *Module* collector:
Copy file name to clipboardExpand all lines: docs/source/reference/changelog.rst
+5
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,11 @@
2
2
Changelog
3
3
=========
4
4
5
+
0.24.0 (UNRELEASED)
6
+
===================
7
+
- Deprecates the optional `scope` keyword argument of asyncio markers. Users are encouraged to use the `loop_scope` keyword argument. The `loop_scope` kwarg does exactly the same, though its naming is consistent with the `loop_scope` kwarg of ``pytest_asyncio.fixture``.
8
+
9
+
5
10
0.23.8 (2024-07-17)
6
11
===================
7
12
- Fixes a bug that caused duplicate markers in async tests `#813 <https://github.com/pytest-dev/pytest-asyncio/issues/813>`_
Copy file name to clipboardExpand all lines: docs/source/reference/markers/index.rst
+1-1
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ Multiple async tests in a single class or module can be marked using |pytestmark
18
18
The ``pytest.mark.asyncio`` marker can be omitted entirely in |auto mode|_ where the *asyncio* marker is added automatically to *async* test functions.
19
19
20
20
By default, each test runs in it's own asyncio event loop.
21
-
Multiple tests can share the same event loop by providing a *scope* keyword argument to the *asyncio* mark.
21
+
Multiple tests can share the same event loop by providing a *loop_scope* keyword argument to the *asyncio* mark.
22
22
The supported scopes are *class,* and *module,* and *package*.
23
23
The following code example provides a shared event loop for all tests in `TestClassScopedLoop`:
0 commit comments