diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-12-30 22:02:12 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-12-31 00:20:08 -0500 |
commit | 1eaf9dc7776b9833a9fb62fe630b4b9ac63a31f4 (patch) | |
tree | cb5447a3910c64c1d60c6b2a24c53f6c578d7ead /lib/sqlalchemy/testing/exclusions.py | |
parent | c0f9708fde39175c8695fdd87873464f516fdf98 (diff) | |
download | sqlalchemy-1eaf9dc7776b9833a9fb62fe630b4b9ac63a31f4.tar.gz |
rework the exclusions spec expression
The expression was expecting spaces which means we were skipping
Postgresql window function tests and possibly other things.
Change-Id: I57c4aed558f4011f2f7b882a2d9b1fee210f9eaf
Diffstat (limited to 'lib/sqlalchemy/testing/exclusions.py')
-rw-r--r-- | lib/sqlalchemy/testing/exclusions.py | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/lib/sqlalchemy/testing/exclusions.py b/lib/sqlalchemy/testing/exclusions.py index 65b70a5a3..512fffb3b 100644 --- a/lib/sqlalchemy/testing/exclusions.py +++ b/lib/sqlalchemy/testing/exclusions.py @@ -6,14 +6,15 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php -import operator -from ..util import decorator -from . import config -from .. import util -import inspect import contextlib +import operator +import re + from sqlalchemy.util.compat import inspect_getargspec +from . import config +from .. import util +from ..util import decorator def skip_if(predicate, reason=None): rule = compound() @@ -190,13 +191,18 @@ class Predicate(object): elif isinstance(predicate, tuple): return SpecPredicate(*predicate) elif isinstance(predicate, util.string_types): - 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(".")) + tokens = re.match( + r'([\+\w]+)\s*(?:(>=|==|!=|<=|<|>)\s*([\d\.]+))?', predicate) + if not tokens: + raise ValueError( + "Couldn't locate DB name in predicate: %r" % predicate) + db = tokens.group(1) + op = tokens.group(2) + spec = ( + tuple(int(d) for d in tokens.group(3).split(".")) + if tokens.group(3) else None + ) + return SpecPredicate(db, op, spec, description=description) elif util.callable(predicate): return LambdaPredicate(predicate, description) |