summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/requirements.py
diff options
context:
space:
mode:
authorGord Thompson <gord@gordthompson.com>2020-04-02 11:51:11 -0600
committerGord Thompson <gord@gordthompson.com>2020-04-02 11:51:11 -0600
commit207e0b2fc0b36acca398b163c698412deec7077e (patch)
tree1bd3b739655cefd2d67b8a01bbaf961c1a708d57 /lib/sqlalchemy/testing/requirements.py
parenta9b62055bfa61c11e9fe0b2984437e2c3e32bf0e (diff)
downloadsqlalchemy-207e0b2fc0b36acca398b163c698412deec7077e.tar.gz
Broaden is[not]_distinct_from support
Added support for .is[not]_distinct_from to SQL Server, MySQL, and Oracle. Fixes: #5137 Change-Id: I3b4d3b199821a55687f83c9a5b63a95d07a64cd5
Diffstat (limited to 'lib/sqlalchemy/testing/requirements.py')
-rw-r--r--lib/sqlalchemy/testing/requirements.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py
index 5ee0d67a2..644483b79 100644
--- a/lib/sqlalchemy/testing/requirements.py
+++ b/lib/sqlalchemy/testing/requirements.py
@@ -1168,3 +1168,19 @@ class SuiteRequirements(Requirements):
"""If persistence information is returned by the reflection of
computed columns"""
return exclusions.closed()
+
+ @property
+ def supports_is_distinct_from(self):
+ """Supports some form of "x IS [NOT] DISTINCT FROM y" construct.
+ Different dialects will implement their own flavour, e.g.,
+ sqlite will emit "x IS NOT y" instead of "x IS DISTINCT FROM y".
+
+ .. seealso::
+
+ :meth:`.ColumnOperators.is_distinct_from`
+
+ """
+ return exclusions.skip_if(
+ lambda config: not config.db.dialect.supports_is_distinct_from,
+ "driver doesn't support an IS DISTINCT FROM construct",
+ )