Skip to content

Commit a2e3291

Browse files
committed
Run tests in local python version
1 parent aad4396 commit a2e3291

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

tests/integrations/aws_lambda/utils.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import os
44
import requests
5+
import sys
56
import time
67
import threading
78

@@ -16,6 +17,7 @@
1617
from scripts.build_aws_lambda_layer import build_packaged_zip, DIST_PATH
1718

1819

20+
PYTHON_VERSION = f"python{sys.version_info.major}.{sys.version_info.minor}"
1921
SAM_PORT = 3001
2022
FUNCTIONS_DIR = "./tests/integrations/aws_lambda/lambda_functions/"
2123

@@ -45,13 +47,7 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
4547
properties={
4648
"ContentUri": os.path.join(DIST_PATH, filename),
4749
"CompatibleRuntimes": [
48-
"python3.7",
49-
"python3.8",
50-
"python3.9",
51-
"python3.10",
52-
"python3.11",
53-
"python3.12",
54-
"python3.13",
50+
PYTHON_VERSION,
5551
],
5652
},
5753
)
@@ -69,7 +65,7 @@ def __init__(self, scope: Construct, construct_id: str, **kwargs) -> None:
6965
properties={
7066
"CodeUri": os.path.join(FUNCTIONS_DIR, lambda_dir),
7167
"Handler": "sentry_sdk.integrations.init_serverless_sdk.sentry_lambda_handler",
72-
"Runtime": "python3.12",
68+
"Runtime": PYTHON_VERSION,
7369
"Timeout": 15,
7470
"Layers": [{"Ref": self.sentry_layer.logical_id}], # Add layer containing the Sentry SDK to function.
7571
"Environment": {

tox.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ deps =
361361

362362
# AWS Lambda
363363
aws_lambda: boto3
364+
aws_lambda: fastapi
365+
aws_lambda: uvicorn
366+
364367

365368
# Beam
366369
beam-v2.12: apache-beam~=2.12.0

0 commit comments

Comments
 (0)