From f876f9b05c5d8e997189834512743d95b0dbdfa3 Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Thu, 14 Sep 2023 16:14:51 +0200 Subject: [PATCH 1/2] Use pytest_runtestloop instead of pytest_sessionstart --- localstack/testing/pytest/in_memory_localstack.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/localstack/testing/pytest/in_memory_localstack.py b/localstack/testing/pytest/in_memory_localstack.py index b733c84f6eb32..29de0f14c7a94 100644 --- a/localstack/testing/pytest/in_memory_localstack.py +++ b/localstack/testing/pytest/in_memory_localstack.py @@ -42,8 +42,9 @@ def pytest_addoption(parser: Parser, pluginmanager: PytestPluginManager): @pytest.hookimpl(tryfirst=True) -def pytest_sessionstart(session: Session): +def pytest_runtestloop(session: Session): if not session.config.option.start_localstack: + LOG.info("Configuration option to start LocalStack not set.") return from localstack.testing.aws.util import is_aws_cloud From 20d041c4c016f69a502e6f7d9c0d36d00ef1e434 Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Thu, 14 Sep 2023 17:06:27 +0200 Subject: [PATCH 2/2] fix nits --- localstack/testing/pytest/in_memory_localstack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localstack/testing/pytest/in_memory_localstack.py b/localstack/testing/pytest/in_memory_localstack.py index 29de0f14c7a94..04469e4744f33 100644 --- a/localstack/testing/pytest/in_memory_localstack.py +++ b/localstack/testing/pytest/in_memory_localstack.py @@ -25,6 +25,7 @@ def pytest_configure(config): from localstack.constants import ENV_INTERNAL_TEST_RUN LOG = logging.getLogger(__name__) +LOG.info("Pytest plugin for in-memory-localstack session loaded.") if localstack_config.is_collect_metrics_mode(): pytest_plugins = "localstack.testing.pytest.metric_collection" @@ -44,7 +45,6 @@ def pytest_addoption(parser: Parser, pluginmanager: PytestPluginManager): @pytest.hookimpl(tryfirst=True) def pytest_runtestloop(session: Session): if not session.config.option.start_localstack: - LOG.info("Configuration option to start LocalStack not set.") return from localstack.testing.aws.util import is_aws_cloud