Change-Id: Id2e965aa13a6d7134ca1081554cc5b25dbcc9fde
from sqlalchemy.testing import config
from sqlalchemy.testing import fixtures
+from sqlalchemy.testing import requires
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",
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")