]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
test(config): add test for integer value in TOML configuration
authorLuís Henrique Allebrandt Schunemann <44511825+luishenri@users.noreply.github.com>
Thu, 14 Aug 2025 21:51:26 +0000 (18:51 -0300)
committerLuís Henrique Allebrandt Schunemann <44511825+luishenri@users.noreply.github.com>
Thu, 14 Aug 2025 21:51:26 +0000 (18:51 -0300)
tests/test_config.py

index 40a22f7179334c904c5f6e992b1f9f717f52b967..1205fbf2c1983a9df8eda43c12a635e97c5bb052 100644 (file)
@@ -586,6 +586,23 @@ script_location = "%(here)s/scripts"
             sd = ScriptDirectory.from_config(cfg)
             eq_(getattr(sd, paramname), bool(argtype.true))
 
+    def test_toml_int_value(self, pyproject_only_env):
+        cfg = pyproject_only_env
+        with cfg._toml_file_path.open("wb") as file_:
+            file_.write(
+                rb"""
+[tool.alembic]
+script_location = "%(here)s/scripts"
+
+my_int = 42
+"""
+            )
+        if "toml_alembic_config" in cfg.__dict__:
+            cfg.__dict__.pop("toml_alembic_config")
+
+        value = cfg.get_alembic_option("my_int")
+        eq_(value, "42")
+
 
 class StdoutOutputEncodingTest(TestBase):
     def test_plain(self):