Skip to content

Commit d6a3701

Browse files
committed
brought fixture in
1 parent c930c8c commit d6a3701

File tree

31 files changed

+36
-8
lines changed

31 files changed

+36
-8
lines changed

packages/aws-library/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"pytest_simcore.aws_ssm_service",
1515
"pytest_simcore.environment_configs",
1616
"pytest_simcore.file_extra",
17+
"pytest_simcore.logging",
1718
"pytest_simcore.pydantic_models",
1819
"pytest_simcore.pytest_global_environs",
1920
"pytest_simcore.repository_paths",

packages/celery-library/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"pytest_simcore.docker_compose",
2727
"pytest_simcore.docker_swarm",
2828
"pytest_simcore.environment_configs",
29+
"pytest_simcore.logging",
2930
"pytest_simcore.rabbit_service",
3031
"pytest_simcore.redis_service",
3132
"pytest_simcore.repository_paths",

packages/common-library/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import pytest
1010

1111
pytest_plugins = [
12+
"pytest_simcore.logging",
1213
"pytest_simcore.pydantic_models",
1314
"pytest_simcore.pytest_global_environs",
1415
"pytest_simcore.repository_paths",

packages/dask-task-models-library/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import pytest
88

99
pytest_plugins = [
10+
"pytest_simcore.logging",
1011
"pytest_simcore.pydantic_models",
1112
"pytest_simcore.pytest_global_environs",
1213
"pytest_simcore.repository_paths",

packages/models-library/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
pytest_plugins = [
1212
"pytest_simcore.faker_projects_data",
13+
"pytest_simcore.logging",
1314
"pytest_simcore.pydantic_models",
1415
"pytest_simcore.pytest_global_environs",
1516
"pytest_simcore.repository_paths",

packages/notifications-library/tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"pytest_simcore.faker_payments_data",
3030
"pytest_simcore.faker_products_data",
3131
"pytest_simcore.faker_users_data",
32+
"pytest_simcore.logging",
3233
"pytest_simcore.postgres_service",
3334
"pytest_simcore.repository_paths",
3435
]
@@ -72,7 +73,7 @@ def product_data(
7273
return ProductData( # type: ignore
7374
product_name=product_name,
7475
display_name=product["display_name"],
75-
vendor_display_inline=f"{vendor.get('name','')}, {vendor.get('address','')}",
76+
vendor_display_inline=f"{vendor.get('name', '')}, {vendor.get('address', '')}",
7677
support_email=product["support_email"],
7778
homepage_url=vendor.get("url"),
7879
ui=product_ui,

packages/postgres-database/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from sqlalchemy.ext.asyncio import AsyncConnection, AsyncEngine, create_async_engine
4242

4343
pytest_plugins = [
44+
"pytest_simcore.logging",
4445
"pytest_simcore.pytest_global_environs",
4546
"pytest_simcore.repository_paths",
4647
]

packages/pytest-simcore/src/pytest_simcore/logging.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# In conftest.py or test_logging_utils.py
22
import logging
3-
from collections.abc import AsyncIterator
4-
from contextlib import asynccontextmanager
3+
from collections.abc import Iterator
4+
from contextlib import contextmanager
55
from unittest.mock import patch
66

77
import pytest
@@ -19,15 +19,15 @@ def preserve_caplog_for_async_logging(request):
1919
# Patch setup_async_loggers_lifespan to preserve caplog handlers
2020
original_setup = setup_async_loggers_lifespan
2121

22-
@asynccontextmanager
23-
async def patched_setup_async_loggers_lifespan(**kwargs) -> AsyncIterator[None]:
22+
@contextmanager
23+
def patched_setup_async_loggers_lifespan(**kwargs) -> Iterator[None]:
2424
# Find caplog's handler in root logger
2525
root_logger = logging.getLogger()
2626
caplog_handlers = [
2727
h for h in root_logger.handlers if "LogCaptureHandler" in f"{type(h)}"
2828
]
2929

30-
async with original_setup(**kwargs):
30+
with original_setup(**kwargs):
3131
# After setup, restore caplog handlers alongside queue handler
3232
for handler in caplog_handlers:
3333
if handler not in root_logger.handlers:

packages/settings-library/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
pytest_plugins = [
1919
"pytest_simcore.cli_runner",
2020
"pytest_simcore.environment_configs",
21+
"pytest_simcore.logging",
2122
"pytest_simcore.pydantic_models",
2223
"pytest_simcore.pytest_global_environs",
2324
"pytest_simcore.repository_paths",

packages/simcore-sdk/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"pytest_simcore.docker_compose",
2929
"pytest_simcore.docker_swarm",
3030
"pytest_simcore.file_extra",
31+
"pytest_simcore.logging",
3132
"pytest_simcore.minio_service",
3233
"pytest_simcore.postgres_service",
3334
"pytest_simcore.pytest_global_environs",

0 commit comments

Comments
 (0)