]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Skip for SQL Server on non-native boolean unconstrained
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 17 May 2018 23:57:01 +0000 (19:57 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 17 May 2018 23:57:01 +0000 (19:57 -0400)
As SQL Server is now non-native boolean as of
I4765d2a2a00b0d14f50282603cc4d48d4739dac1 but uses the BIT
type, we need to constrain this test to continue to not
run against SQL Server.

Change-Id: I214faf2b788a0e8e10725622e3e71f3b70805533

test/requirements.py
test/sql/test_types.py

index 1b6559cf9e50765e4097b3d95eba24d872d6aa35..4a53b76ecb6904c1a308b34d6196e912540ff0ec 100644 (file)
@@ -140,6 +140,22 @@ class DefaultRequirements(SuiteRequirements):
             no_support('sybase', 'not supported by database'),
         ])
 
+    @property
+    def non_native_boolean_unconstrained(self):
+        """target database is not native boolean and allows arbitrary integers
+        in it's "bool" column"""
+
+        return skip_if([
+            LambdaPredicate(
+                lambda config: against(config, "mssql"),
+                "SQL Server drivers / odbc seem to change their mind on this"
+            ),
+            LambdaPredicate(
+                lambda config: config.db.dialect.supports_native_boolean,
+                "native boolean dialect"
+            )
+        ])
+
     @property
     def standalone_binds(self):
         """target database/driver supports bound parameters as column expressions
index 5fbfcd2d82121a011aedaa4d3035121d49f5aea7..3fdc6169f29a6a88a6179e029a844b0771cf3f9a 100644 (file)
@@ -2754,7 +2754,7 @@ class BooleanTest(
             )
 
 
-    @testing.skip_if(lambda: testing.db.dialect.supports_native_boolean)
+    @testing.requires.non_native_boolean_unconstrained
     def test_nonnative_processor_coerces_integer_to_boolean(self):
         boolean_table = self.tables.boolean_table
         with testing.db.connect() as conn: