diff options
Diffstat (limited to 'test/requirements.py')
-rw-r--r-- | test/requirements.py | 59 |
1 files changed, 55 insertions, 4 deletions
diff --git a/test/requirements.py b/test/requirements.py index 0a695b641..3ed6bea4d 100644 --- a/test/requirements.py +++ b/test/requirements.py @@ -30,7 +30,7 @@ def exclude(db, op, spec, description=None): class DefaultRequirements(SuiteRequirements): @property def deferrable_or_no_constraints(self): - """Target database must support derferable constraints.""" + """Target database must support deferrable constraints.""" return skip_if([ no_support('firebird', 'not supported by database'), @@ -39,6 +39,12 @@ class DefaultRequirements(SuiteRequirements): ]) @property + def check_constraints(self): + """Target database must support check constraints.""" + + return exclusions.open() + + @property def named_constraints(self): """target database must support names for constraints.""" @@ -121,6 +127,17 @@ class DefaultRequirements(SuiteRequirements): ) @property + def temporary_tables(self): + """target database supports temporary tables""" + return skip_if( + ["mssql"], "sql server has some other syntax?" + ) + + @property + def temp_table_reflection(self): + return self.temporary_tables + + @property def reflectable_autoincrement(self): """Target database must support tables that can automatically generate PKs assuming they were reflected. @@ -355,7 +372,7 @@ class DefaultRequirements(SuiteRequirements): @property def window_functions(self): return only_if([ - "postgresql", "mssql", "oracle" + "postgresql>=8.4", "mssql", "oracle" ], "Backend does not support window functions") @property @@ -443,13 +460,14 @@ class DefaultRequirements(SuiteRequirements): ) + @property def emulated_lastrowid(self): """"target dialect retrieves cursor.lastrowid or an equivalent after an insert() construct executes. """ return fails_on_everything_except('mysql', - 'sqlite+pysqlite', + 'sqlite+pysqlite', 'sqlite+pysqlcipher', 'sybase', 'mssql') @property @@ -466,7 +484,7 @@ class DefaultRequirements(SuiteRequirements): """ return skip_if('mssql+pymssql', 'crashes on pymssql') + \ fails_on_everything_except('mysql', - 'sqlite+pysqlite') + 'sqlite+pysqlite', 'sqlite+pysqlcipher') @property def sane_multi_rowcount(self): @@ -638,6 +656,10 @@ class DefaultRequirements(SuiteRequirements): 'postgresql+pg8000', None, None, 'postgresql+pg8000 has FP inaccuracy even with ' 'only four decimal places '), + ( + 'postgresql+psycopg2cffi', None, None, + 'postgresql+psycopg2cffi has FP inaccuracy even with ' + 'only four decimal places '), ]) @property @@ -731,6 +753,14 @@ class DefaultRequirements(SuiteRequirements): ) @property + def postgresql_jsonb(self): + return skip_if( + lambda config: + config.db.dialect.driver == "pg8000" and + config.db.dialect._dbapi_version <= (1, 10, 1) + ) + + @property def percent_schema_names(self): return skip_if( [ @@ -738,6 +768,10 @@ class DefaultRequirements(SuiteRequirements): "+psycopg2", None, None, "psycopg2 2.4 no longer accepts percent " "sign in bind placeholders"), + ( + "+psycopg2cffi", None, None, + "psycopg2cffi does not accept percent signs in " + "bind placeholders"), ("mysql", None, None, "executemany() doesn't work here") ] ) @@ -760,6 +794,17 @@ class DefaultRequirements(SuiteRequirements): "Not supported on MySQL + Windows" ) + @property + def mssql_freetds(self): + return only_on( + LambdaPredicate( + lambda config: ( + (against(config, 'mssql+pyodbc') and + config.db.dialect.freetds) + or against(config, 'mssql+pymssql') + ) + ) + ) @property def selectone(self): @@ -779,3 +824,9 @@ class DefaultRequirements(SuiteRequirements): return against(config, 'mysql') and \ config.db.dialect._detect_casing(config.db) == 0 + @property + def postgresql_utf8_server_encoding(self): + return only_if( + lambda config: against(config, 'postgresql') and + config.db.scalar("show server_encoding").lower() == "utf8" + ) |