From: Mike Bayer Date: Thu, 17 May 2018 23:57:01 +0000 (-0400) Subject: Skip for SQL Server on non-native boolean unconstrained X-Git-Tag: rel_1_3_0b1~180 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2bacad469c0b07cc707b563e37e835abcf96eb8;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Skip for SQL Server on non-native boolean unconstrained 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 --- diff --git a/test/requirements.py b/test/requirements.py index 1b6559cf9e..4a53b76ecb 100644 --- a/test/requirements.py +++ b/test/requirements.py @@ -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 diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 5fbfcd2d82..3fdc6169f2 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -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: