Skip to content

Commit 8870edb

Browse files
authored
chore: update pytest-asyncio (microsoft#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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 10 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy