Skip to content

Commit 8870edb

Browse files
authored
chore: update pytest-asyncio (#2783)
1 parent 4628609 commit 8870edb

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

local-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pixelmatch==0.3.0
99
pre-commit==3.5.0
1010
pyOpenSSL==25.0.0
1111
pytest==8.3.5
12-
pytest-asyncio==0.25.3
12+
pytest-asyncio==0.26.0
1313
pytest-cov==6.0.0
1414
pytest-repeat==0.9.3
1515
pytest-rerunfailures==15.0

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ markers = [
6767
junit_family = "xunit2"
6868
asyncio_mode = "auto"
6969
asyncio_default_fixture_loop_scope = "session"
70+
asyncio_default_test_loop_scope = "session"
7071

7172
[tool.mypy]
7273
ignore_missing_imports = true

tests/async/conftest.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
# limitations under the License.
1414

1515
import asyncio
16-
from typing import Any, AsyncGenerator, Awaitable, Callable, Dict, Generator, List
16+
from typing import Any, AsyncGenerator, Awaitable, Callable, Dict, Generator
1717

1818
import pytest
19-
from pytest_asyncio import is_async_test
2019

2120
from playwright.async_api import (
2221
Browser,
@@ -37,14 +36,6 @@ def utils() -> Generator[Utils, None, None]:
3736
yield utils_object
3837

3938

40-
# Will mark all the tests as async
41-
def pytest_collection_modifyitems(items: List[pytest.Item]) -> None:
42-
pytest_asyncio_tests = (item for item in items if is_async_test(item))
43-
session_scope_marker = pytest.mark.asyncio(loop_scope="session")
44-
for async_test in pytest_asyncio_tests:
45-
async_test.add_marker(session_scope_marker, append=False)
46-
47-
4839
@pytest.fixture(scope="session")
4940
async def playwright() -> AsyncGenerator[Playwright, None]:
5041
async with async_playwright() as playwright_object:

0 commit comments

Comments
 (0)