]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
try fixing the build
authorFederico Caselli <cfederico87@gmail.com>
Mon, 13 Jun 2022 20:15:48 +0000 (22:15 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Mon, 13 Jun 2022 20:15:48 +0000 (22:15 +0200)
Change-Id: Id2e965aa13a6d7134ca1081554cc5b25dbcc9fde

test/base/test_tutorials.py
test/requirements.py

index 5a0d8c8ac814563074376dcb4db959ae40a8a14f..743f91f74f0d7e2b8399a07b311c99def1efbfad 100644 (file)
@@ -6,6 +6,7 @@ import sys
 
 from sqlalchemy.testing import config
 from sqlalchemy.testing import fixtures
+from sqlalchemy.testing import requires
 
 
 class DocTest(fixtures.TestBase):
@@ -83,6 +84,7 @@ class DocTest(fixtures.TestBase):
                 globs.update(test.globs)
                 assert not runner.failures
 
+    @requires.has_json_each
     def test_20_style(self):
         self._run_doctest(
             "tutorial/index.rst",
index d974359dc5e99bb1e22bc9c1f37e147bb42cc3b8..2d0876158d0b1aec58a03fac4fdb4f7fc76e041c 100644 (file)
@@ -1785,3 +1785,17 @@ class DefaultRequirements(SuiteRequirements):
     def uuid_data_type(self):
         """Return databases that support the UUID datatype."""
         return only_on(("postgresql >= 8.3", "mariadb >= 10.7.0"))
+
+    @property
+    def has_json_each(self):
+        def go(config):
+            try:
+                with config.db.connect() as conn:
+                    conn.exec_driver_sql(
+                        """SELECT x.value FROM json_each('["b", "a"]') as x"""
+                    )
+                return True
+            except exc.DBAPIError:
+                return False
+
+        return only_if(go, "json_each is required")