]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- support addition of fails_if()/only_on(), just wraps the decorators
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 2 Jan 2014 19:23:14 +0000 (14:23 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 2 Jan 2014 19:24:44 +0000 (14:24 -0500)
- update a few exclusions to support current pymssql.  passes all of test_suite and dialect/mssql

lib/sqlalchemy/testing/exclusions.py
test/dialect/mssql/test_query.py
test/requirements.py

index 2c0679e1d3dfce385f5e408ef91e0b4159024df4..b3f6b22536294a428be5701503806df63cb6ab0e 100644 (file)
@@ -19,6 +19,11 @@ class skip_if(object):
     def enabled(self):
         return not self.predicate()
 
+    def __add__(self, other):
+        def decorate(fn):
+            return other(self(fn))
+        return decorate
+
     @contextlib.contextmanager
     def fail_if(self, name='block'):
         try:
index bff737145c9d4a1fc948107db665ec7111cc1755..6a12744a73ce0efd0bd17933c8dd94005d005e99 100644 (file)
@@ -232,9 +232,10 @@ class QueryTest(testing.AssertsExecutionResults, fixtures.TestBase):
             con.execute("""drop trigger paj""")
             meta.drop_all()
 
+    @testing.fails_on_everything_except('mssql+pyodbc', 'pyodbc-specific feature')
     @testing.provide_metadata
     def test_disable_scope_identity(self):
-        engine = engines.testing_engine(options={"use_scope_identity":False})
+        engine = engines.testing_engine(options={"use_scope_identity": False})
         metadata = self.metadata
         metadata.bind = engine
         t1 = Table('t1', metadata,
index 21583ec22c4821e0dd181c5b8f86cef0cf91bac3..25b5b72058c2eae61819a49973a231d4a50a6df2 100644 (file)
@@ -406,7 +406,7 @@ class DefaultRequirements(SuiteRequirements):
         return fails_on_everything_except('mysql+mysqldb', 'mysql+oursql',
                                       'sqlite+pysqlite', 'mysql+pymysql',
                                       'mysql+cymysql',
-                                      'sybase', 'mssql+pyodbc', 'mssql+mxodbc')
+                                      'sybase', 'mssql')
 
     @property
     def implements_get_lastrowid(self):
@@ -420,7 +420,8 @@ class DefaultRequirements(SuiteRequirements):
         cursor object.
 
         """
-        return fails_on_everything_except('mysql+mysqldb', 'mysql+oursql',
+        return skip_if('mssql+pymssql', 'crashes on pymssql') + \
+                    fails_on_everything_except('mysql+mysqldb', 'mysql+oursql',
                                        'sqlite+pysqlite', 'mysql+pymysql',
                                        'mysql+cymysql')
 
@@ -498,13 +499,14 @@ class DefaultRequirements(SuiteRequirements):
     def precision_numerics_general(self):
         """target backend has general support for moderately high-precision
         numerics."""
-        return fails_if('mssql+pymssql', 'FIXME: improve pymssql dec handling')
+        return exclusions.open()
 
     @property
     def precision_numerics_enotation_small(self):
         """target backend supports Decimal() objects using E notation
         to represent very small values."""
-        return fails_if('mssql+pymssql', 'FIXME: improve pymssql dec handling')
+        # NOTE: this exclusion isn't used in current tests.
+        return exclusions.open()
 
     @property
     def precision_numerics_enotation_large(self):
@@ -570,6 +572,10 @@ class DefaultRequirements(SuiteRequirements):
                     ('mssql+pyodbc', None, None,
                                 'mssql+pyodbc has FP inaccuracy even with '
                                 'only four decimal places '
+                            ),
+                    ('mssql+pymssql', None, None,
+                                'mssql+pymssql has FP inaccuracy even with '
+                                'only four decimal places '
                             )
                 ])