diff options
| author | Federico Caselli <cfederico87@gmail.com> | 2022-06-13 22:15:48 +0200 |
|---|---|---|
| committer | Federico Caselli <cfederico87@gmail.com> | 2022-06-13 22:15:48 +0200 |
| commit | 92bd08c3daff74b94652a5edefd5efa7632ccb22 (patch) | |
| tree | afc51d334b6159850ffbb3427e5218898e4e47de | |
| parent | 4010a61af7b88e0d3b18bcd560a465269384f250 (diff) | |
| download | sqlalchemy-92bd08c3daff74b94652a5edefd5efa7632ccb22.tar.gz | |
try fixing the build
Change-Id: Id2e965aa13a6d7134ca1081554cc5b25dbcc9fde
| -rw-r--r-- | test/base/test_tutorials.py | 2 | ||||
| -rw-r--r-- | test/requirements.py | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/base/test_tutorials.py b/test/base/test_tutorials.py index 5a0d8c8ac..743f91f74 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 d974359dc..2d0876158 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") |
