From: Federico Caselli Date: Mon, 13 Jun 2022 20:15:48 +0000 (+0200) Subject: try fixing the build X-Git-Tag: rel_1_4_38~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=01b40e9e519fc24edc32f76e085fe4719982181a;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git try fixing the build Change-Id: Id2e965aa13a6d7134ca1081554cc5b25dbcc9fde (cherry picked from commit 92bd08c3daff74b94652a5edefd5efa7632ccb22) # Conflicts: # test/requirements.py --- diff --git a/test/base/test_tutorials.py b/test/base/test_tutorials.py index 74011d3d49..bde7baa750 100644 --- a/test/base/test_tutorials.py +++ b/test/base/test_tutorials.py @@ -9,6 +9,7 @@ import sys from sqlalchemy import testing from sqlalchemy.testing import config from sqlalchemy.testing import fixtures +from sqlalchemy.testing import requires class DocTest(fixtures.TestBase): @@ -88,6 +89,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 dda8fd6cbb..e47099013e 100644 --- a/test/requirements.py +++ b/test/requirements.py @@ -1894,3 +1894,17 @@ class DefaultRequirements(SuiteRequirements): return res is not None return only_on(["mssql"]) + only_if(check) + + @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")