summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-08-18 13:02:58 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-08-18 13:30:21 -0400
commitb653fedca5f0fc384c990e93d82c0780c9e76f2c (patch)
tree1db38099654d19d3e528853035a1c33aa487e29d
parent3f8f1f16bd9e284afee910a6036fcb0958a6c0c2 (diff)
downloadsqlalchemy-b653fedca5f0fc384c990e93d82c0780c9e76f2c.tar.gz
- fix the postgresql_jsonb requirement to include the 9.4 requirement
- new test for json col['x']['y']['z'] seems to fail pre PG 9.4, fails on comparisons for non-compatible data instead of not matching - no need to call SpecPredicate(db) directly in exclusion functions, by using Predicate.as_predicate() the spec strings can have version comparisons
-rw-r--r--lib/sqlalchemy/testing/exclusions.py6
-rw-r--r--test/dialect/mssql/test_types.py4
-rw-r--r--test/dialect/postgresql/test_types.py4
-rw-r--r--test/requirements.py2
4 files changed, 8 insertions, 8 deletions
diff --git a/lib/sqlalchemy/testing/exclusions.py b/lib/sqlalchemy/testing/exclusions.py
index 972dec3a9..c7d06fceb 100644
--- a/lib/sqlalchemy/testing/exclusions.py
+++ b/lib/sqlalchemy/testing/exclusions.py
@@ -407,19 +407,19 @@ def future(fn, *arg):
def fails_on(db, reason=None):
- return fails_if(SpecPredicate(db), reason)
+ return fails_if(Predicate.as_predicate(db), reason)
def fails_on_everything_except(*dbs):
return succeeds_if(
OrPredicate([
- SpecPredicate(db) for db in dbs
+ Predicate.as_predicate(db) for db in dbs
])
)
def skip(db, reason=None):
- return skip_if(SpecPredicate(db), reason)
+ return skip_if(Predicate.as_predicate(db), reason)
def only_on(dbs, reason=None):
diff --git a/test/dialect/mssql/test_types.py b/test/dialect/mssql/test_types.py
index 17ceb6b61..e782bd5e5 100644
--- a/test/dialect/mssql/test_types.py
+++ b/test/dialect/mssql/test_types.py
@@ -313,9 +313,7 @@ class TypeRoundTripTest(
def teardown(self):
metadata.drop_all()
- @testing.fails_on_everything_except(
- 'mssql+pyodbc',
- 'this is some pyodbc-specific feature')
+ @testing.fails_on_everything_except('mssql+pyodbc')
def test_decimal_notation(self):
numeric_table = Table(
'numeric_table', metadata,
diff --git a/test/dialect/postgresql/test_types.py b/test/dialect/postgresql/test_types.py
index 00a2de2db..9d5cb4d91 100644
--- a/test/dialect/postgresql/test_types.py
+++ b/test/dialect/postgresql/test_types.py
@@ -2576,6 +2576,9 @@ class JSONRoundTripTest(fixtures.TablesTest):
)
eq_(result.scalar(), 'r6')
+ @testing.fails_on(
+ "postgresql < 9.4",
+ "Improvement in Postgresql behavior?")
def test_multi_index_query(self):
engine = testing.db
self._fixture_data(engine)
@@ -2746,7 +2749,6 @@ class JSONBTest(JSONTest):
class JSONBRoundTripTest(JSONRoundTripTest):
- __only_on__ = ('postgresql >= 9.4',)
__requires__ = ('postgresql_jsonb', )
test_type = JSONB
diff --git a/test/requirements.py b/test/requirements.py
index 56e197cb2..c25b409d7 100644
--- a/test/requirements.py
+++ b/test/requirements.py
@@ -784,7 +784,7 @@ class DefaultRequirements(SuiteRequirements):
@property
def postgresql_jsonb(self):
- return skip_if(
+ return only_on("postgresql >= 9.4") + skip_if(
lambda config:
config.db.dialect.driver == "pg8000" and
config.db.dialect._dbapi_version <= (1, 10, 1)