Skip to content

Commit

Permalink
Skip docker tests if docker is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
enzbang committed Apr 3, 2024
1 parent 10d3dfc commit ff2f83d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/tests_e3_aws/troposphere/awslambda/awslambda_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@
)
from e3.aws.troposphere.awslambda.flask_apigateway_wrapper import FlaskLambdaHandler

from e3.pytest import require_tool

if TYPE_CHECKING:
from typing import Iterable
from flask import Application, Response


SOURCE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "source_dir")


has_docker = require_tool("docker")


EXPECTED_PY38FUNCTION_TEMPLATE = {
"Mypylambda": {
"Properties": {
Expand Down Expand Up @@ -452,7 +458,7 @@ def test_pyfunction_policy_document(stack: Stack) -> None:
assert stack.cfn_policy_document().as_dict == EXPECTED_PYFUNCTION_POLICY_DOCUMENT


def test_docker_function(stack: Stack) -> None:
def test_docker_function(stack: Stack, has_docker: pytest.Fixture) -> None:
"""Test adding docker function to stack."""
aws_env = AWSEnv(regions=["us-east-1"], stub=True)
stubber_ecr = aws_env.stub("ecr")
Expand Down

0 comments on commit ff2f83d

Please sign in to comment.