Skip to content

Commit e4f87d2

Browse files
committed
adjust fixture
1 parent 633c3db commit e4f87d2

File tree

1 file changed

+12
-10
lines changed
  • packages/pytest-simcore/src/pytest_simcore

1 file changed

+12
-10
lines changed

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ def patched_setup_async_loggers_lifespan(**kwargs) -> Iterator[None]:
3434
root_logger.addHandler(handler)
3535
yield
3636

37-
with (
38-
patch(
39-
"tests.test_logging_utils.setup_async_loggers_lifespan",
40-
patched_setup_async_loggers_lifespan,
41-
),
42-
patch(
43-
"servicelib.logging_utils.setup_async_loggers_lifespan",
44-
patched_setup_async_loggers_lifespan,
45-
),
37+
with patch(
38+
"servicelib.logging_utils.setup_async_loggers_lifespan",
39+
patched_setup_async_loggers_lifespan,
4640
):
47-
yield
41+
try:
42+
with patch(
43+
"tests.test_logging_utils.setup_async_loggers_lifespan",
44+
patched_setup_async_loggers_lifespan,
45+
):
46+
yield
47+
except ModuleNotFoundError:
48+
# NOTE: this is for tests running in service library
49+
yield

0 commit comments

Comments
 (0)