From 851a0c80be65a313e3ca11acf37f7e0654c3b10a Mon Sep 17 00:00:00 2001 From: Aayush Thapa Date: Wed, 11 Oct 2023 13:55:27 -0700 Subject: [PATCH 1/4] skip SAR tests if python version >3.10 --- tests/plugins/application/test_serverless_app_plugin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/plugins/application/test_serverless_app_plugin.py b/tests/plugins/application/test_serverless_app_plugin.py index 6c7271e35..e3c086ce4 100644 --- a/tests/plugins/application/test_serverless_app_plugin.py +++ b/tests/plugins/application/test_serverless_app_plugin.py @@ -2,6 +2,8 @@ from unittest.mock import Mock, patch import boto3 +import pytest +import sys from botocore.exceptions import ClientError from samtranslator.model.exceptions import InvalidResourceException from samtranslator.plugins.application.serverless_app_plugin import ServerlessAppPlugin @@ -51,6 +53,7 @@ def mock_get_region(self, service_name, region_name): return "us-east-1" +@pytest.mark.skipif(sys.version_info > (3, 10), reason="Test fails for python versions >3.10") class TestServerlessAppPlugin_init(TestCase): def setUp(self): client = boto3.client("serverlessrepo", region_name="us-east-1") From 5ba1f48659366a4c3c87688f5d15f3324547ffcb Mon Sep 17 00:00:00 2001 From: Aayush Thapa Date: Wed, 11 Oct 2023 13:59:19 -0700 Subject: [PATCH 2/4] format fix --- tests/plugins/application/test_serverless_app_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/plugins/application/test_serverless_app_plugin.py b/tests/plugins/application/test_serverless_app_plugin.py index e3c086ce4..301797317 100644 --- a/tests/plugins/application/test_serverless_app_plugin.py +++ b/tests/plugins/application/test_serverless_app_plugin.py @@ -1,9 +1,9 @@ +import sys from unittest import TestCase from unittest.mock import Mock, patch import boto3 import pytest -import sys from botocore.exceptions import ClientError from samtranslator.model.exceptions import InvalidResourceException from samtranslator.plugins.application.serverless_app_plugin import ServerlessAppPlugin From f1185f04abaceee3beb97895e4e554f89349f052 Mon Sep 17 00:00:00 2001 From: Aayush Thapa Date: Wed, 11 Oct 2023 14:14:45 -0700 Subject: [PATCH 3/4] skip more tests --- tests/plugins/application/test_serverless_app_plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/plugins/application/test_serverless_app_plugin.py b/tests/plugins/application/test_serverless_app_plugin.py index 301797317..765f61361 100644 --- a/tests/plugins/application/test_serverless_app_plugin.py +++ b/tests/plugins/application/test_serverless_app_plugin.py @@ -118,6 +118,7 @@ def test_not_used_when_sar_client_provided(self): self.client_mock.assert_not_called() +@pytest.mark.skipif(sys.version_info > (3, 10), reason="Test fails for python versions >3.10") class TestServerlessAppPlugin_on_before_transform_template_translate(TestCase): def setUp(self): client = boto3.client("serverlessrepo", region_name="us-east-1") @@ -383,6 +384,7 @@ def __init__(self, app_id="app_id", semver="1.3.5", location=None): # self.plugin.on_before_transform_resource(app_resources[0][0], 'AWS::Serverless::Application', app_resources[0][1].properties) +@pytest.mark.skipif(sys.version_info > (3, 10), reason="Test fails for python versions >3.10") class TestServerlessAppPlugin_on_after_transform_template(TestCase): def test_sar_throttling_doesnt_stop_processing(self): client = Mock() From b06870be8e87d3d434128a8e922996d59aff4953 Mon Sep 17 00:00:00 2001 From: Aayush Thapa Date: Wed, 11 Oct 2023 14:29:06 -0700 Subject: [PATCH 4/4] skip less tests --- tests/plugins/application/test_serverless_app_plugin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/plugins/application/test_serverless_app_plugin.py b/tests/plugins/application/test_serverless_app_plugin.py index 765f61361..1ee3e3beb 100644 --- a/tests/plugins/application/test_serverless_app_plugin.py +++ b/tests/plugins/application/test_serverless_app_plugin.py @@ -384,7 +384,6 @@ def __init__(self, app_id="app_id", semver="1.3.5", location=None): # self.plugin.on_before_transform_resource(app_resources[0][0], 'AWS::Serverless::Application', app_resources[0][1].properties) -@pytest.mark.skipif(sys.version_info > (3, 10), reason="Test fails for python versions >3.10") class TestServerlessAppPlugin_on_after_transform_template(TestCase): def test_sar_throttling_doesnt_stop_processing(self): client = Mock()