]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- enhance the exclusions system to support database versions within the __only_on__...
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 17 Dec 2013 19:24:48 +0000 (14:24 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 17 Dec 2013 19:24:48 +0000 (14:24 -0500)
lib/sqlalchemy/testing/exclusions.py
lib/sqlalchemy/testing/plugin/noseplugin.py

index d126c3aa54f41ffcce0d5689a43aa9dbad6d6367..9f14ee105d91d2052924260739c3813ad883340b 100644 (file)
@@ -98,7 +98,14 @@ class Predicate(object):
         elif isinstance(predicate, tuple):
             return SpecPredicate(*predicate)
         elif isinstance(predicate, util.string_types):
-            return SpecPredicate(predicate, None, None)
+            tokens = predicate.split(" ", 2)
+            op = spec = None
+            db = tokens.pop(0)
+            if tokens:
+                op = tokens.pop(0)
+            if tokens:
+                spec = tuple(int(d) for d in tokens.pop(0).split("."))
+            return SpecPredicate(db, op, spec)
         elif util.callable(predicate):
             return LambdaPredicate(predicate)
         else:
index 704e90d533e75184c7922edd5cda68bda833a56e..b55ba4fc09c2aac56a6a705aeaa242cabab0cfff 100644 (file)
@@ -393,8 +393,9 @@ class NoseSQLAlchemy(Plugin):
                         check.reason if check.reason
                         else
                         (
-                            "'%s' unsupported on DB implementation '%s'" % (
-                                cls.__name__, config.db.name
+                            "'%s' unsupported on DB implementation '%s' == %s" % (
+                                cls.__name__, config.db.name,
+                                config.db.dialect.server_version_info
                             )
                         )
                     )
@@ -403,16 +404,18 @@ class NoseSQLAlchemy(Plugin):
             spec = exclusions.db_spec(*cls.__unsupported_on__)
             if spec(config.db):
                 raise SkipTest(
-                    "'%s' unsupported on DB implementation '%s'" % (
-                     cls.__name__, config.db.name)
+                    "'%s' unsupported on DB implementation '%s' == %s" % (
+                     cls.__name__, config.db.name,
+                        config.db.dialect.server_version_info)
                     )
 
         if getattr(cls, '__only_on__', None):
             spec = exclusions.db_spec(*util.to_list(cls.__only_on__))
             if not spec(config.db):
                 raise SkipTest(
-                    "'%s' unsupported on DB implementation '%s'" % (
-                     cls.__name__, config.db.name)
+                    "'%s' unsupported on DB implementation '%s' == %s" % (
+                     cls.__name__, config.db.name,
+                        config.db.dialect.server_version_info)
                     )
 
         if getattr(cls, '__skip_if__', False):