From 92bd08c3daff74b94652a5edefd5efa7632ccb22 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Mon, 13 Jun 2022 22:15:48 +0200 Subject: [PATCH] try fixing the build Change-Id: Id2e965aa13a6d7134ca1081554cc5b25dbcc9fde --- test/base/test_tutorials.py | 2 ++ test/requirements.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/test/base/test_tutorials.py b/test/base/test_tutorials.py index 5a0d8c8ac8..743f91f74f 100644 --- a/test/base/test_tutorials.py +++ b/test/base/test_tutorials.py @@ -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", diff --git a/test/requirements.py b/test/requirements.py index d974359dc5..2d0876158d 100644 --- a/test/requirements.py +++ b/test/requirements.py @@ -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") -- 2.47.2