Skip to content

Commit 175f22f

Browse files
dfanglsimonrw
authored andcommitted
Defer CDK imports in infra provisioning (#12591)
1 parent 13b8a0d commit 175f22f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

localstack-core/localstack/packages/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from threading import RLock
99
from typing import Any, Callable, Generic, List, Optional, ParamSpec, TypeVar
1010

11-
from plux import Plugin, PluginManager, PluginSpec # type: ignore[import-untyped]
11+
from plux import Plugin, PluginManager, PluginSpec # type: ignore
1212

1313
from localstack import config
1414

tests/aws/conftest.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from localstack import config as localstack_config
1010
from localstack import constants
11-
from localstack.testing.scenario.provisioning import InfraProvisioner
1211
from localstack.testing.snapshots.transformer_utility import (
1312
SNAPSHOT_BASIC_TRANSFORMER,
1413
SNAPSHOT_BASIC_TRANSFORMER_NEW,
@@ -85,6 +84,9 @@ def cdk_template_path():
8584
# Note: Don't move this into testing lib
8685
@pytest.fixture(scope="session")
8786
def infrastructure_setup(cdk_template_path, aws_client):
87+
# Note: import needs to be local to avoid CDK import on every test run, which takes quite some time
88+
from localstack.testing.scenario.provisioning import InfraProvisioner
89+
8890
def _infrastructure_setup(
8991
namespace: str, force_synth: Optional[bool] = False
9092
) -> InfraProvisioner:

0 commit comments

Comments
 (0)