nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: cloudtools/troposphere
Pull request #2089 (2022-10-25 10:46:29)

Run tests against Python 3.11 and add trove classifier
released on 2022-10-24, see https://pythoninsider.blogspot.com/2022/10/python-3110-is-now-available.html


Patch:
diff --git a/setup.cfg b/setup.cfg
index 90c55f8d..95806a8c 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -20,6 +20,7 @@ classifiers =
     Programming Language :: Python :: 3.8
     Programming Language :: Python :: 3.9
     Programming Language :: Python :: 3.10
+    Programming Language :: Python :: 3.11
 project_urls =
     Changelog = https://github.com/cloudtools/troposphere/blob/master/CHANGELOG.md
     Source = https://github.com/cloudtools/troposphere
diff --git a/troposphere/validators/rds.py b/troposphere/validators/rds.py
index a7209308..3640e297 100644
--- a/troposphere/validators/rds.py
+++ b/troposphere/validators/rds.py
@@ -340,12 +340,18 @@ def validate_dbinstance(self) -> None:
     allocated_storage = self.properties.get("AllocatedStorage")
     iops = self.properties.get("Iops", None)
     if iops and not isinstance(iops, AWSHelperFn):
+        min_storage_size = 100
+        engine = self.properties.get("Engine")
+        if not isinstance(engine, AWSHelperFn) and engine.startswith("sqlserver"):
+            min_storage_size = 20
+
         if (
             not isinstance(allocated_storage, AWSHelperFn)
-            and int(allocated_storage) < 100
+            and int(allocated_storage) < min_storage_size
         ):
             raise ValueError(
-                "AllocatedStorage must be at least 100 when " "Iops is set."
+                f"AllocatedStorage must be at least {min_storage_size} when "
+                "Iops is set."
             )
         if (
             not isinstance(allocated_storage, AWSHelperFn)


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 07f404e6..b2272181 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -15,7 +15,7 @@ jobs:
     name: Python Linting & Tests
     strategy:
       matrix:
-        python-version: ["3.7", "3.8", "3.9", "3.10"]
+        python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
         os: [ubuntu-latest]
     runs-on: ${{ matrix.os }}
     steps:
diff --git a/tests/test_rds.py b/tests/test_rds.py
index 9732c784..f00e7f66 100644
--- a/tests/test_rds.py
+++ b/tests/test_rds.py
@@ -205,6 +205,23 @@ class TestRDS(unittest.TestCase):
         i.Iops = 5000
         i.to_dict()
 
+    def test_storage_sqlserver(self):
+        i = rds.DBInstance(
+            "NoAZAndMultiAZ",
+            MasterUsername="myuser",
+            MasterUserPassword="mypassword",
+            DBInstanceClass="db.m1.small",
+            Engine="sqlserver-ee",
+            StorageType="io1",
+            Iops=1000,
+            AllocatedStorage=10,
+        )
+        with self.assertRaisesRegex(ValueError, " must be at least 20 "):
+            i.to_dict()
+
+        i.AllocatedStorage = 20
+        i.to_dict()
+
     def test_snapshot(self):
         i = rds.DBInstance(
             "MyDB",