From: Federico Caselli Date: Mon, 13 Jun 2022 20:15:48 +0000 (+0200) Subject: try fixing the build X-Git-Tag: rel_2_0_0b1~238^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92bd08c3daff74b94652a5edefd5efa7632ccb22;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git try fixing the build Change-Id: Id2e965aa13a6d7134ca1081554cc5b25dbcc9fde --- 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")