Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion local-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pixelmatch==0.3.0
pre-commit==3.5.0
pyOpenSSL==25.0.0
pytest==8.3.5
pytest-asyncio==0.25.3
pytest-asyncio==0.26.0
pytest-cov==6.0.0
pytest-repeat==0.9.3
pytest-rerunfailures==15.0
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ markers = [
junit_family = "xunit2"
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
asyncio_default_test_loop_scope = "session"

[tool.mypy]
ignore_missing_imports = true
Expand Down
11 changes: 1 addition & 10 deletions tests/async/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
# limitations under the License.

import asyncio
from typing import Any, AsyncGenerator, Awaitable, Callable, Dict, Generator, List
from typing import Any, AsyncGenerator, Awaitable, Callable, Dict, Generator

import pytest
from pytest_asyncio import is_async_test

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


# Will mark all the tests as async
def pytest_collection_modifyitems(items: List[pytest.Item]) -> None:
pytest_asyncio_tests = (item for item in items if is_async_test(item))
session_scope_marker = pytest.mark.asyncio(loop_scope="session")
for async_test in pytest_asyncio_tests:
async_test.add_marker(session_scope_marker, append=False)


@pytest.fixture(scope="session")
async def playwright() -> AsyncGenerator[Playwright, None]:
async with async_playwright() as playwright_object:
Expand Down
Loading