]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- fix the postgresql_jsonb requirement to include the 9.4 requirement
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 18 Aug 2015 17:02:58 +0000 (13:02 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 18 Aug 2015 17:30:21 +0000 (13:30 -0400)
- 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

lib/sqlalchemy/testing/exclusions.py
test/dialect/mssql/test_types.py
test/dialect/postgresql/test_types.py
test/requirements.py

index 972dec3a95ff6609479273ff4b4cb992a55435d7..c7d06fceb3a2da44bfd5368c8c10d3627c0d4876 100644 (file)
@@ -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):
index 17ceb6b61a72267d217b6888ab211e93bf981889..e782bd5e595b7a54ba2f100b213926b0bbb7d72f 100644 (file)
@@ -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,
index 00a2de2dbea6a3a25062d8c93da6282fd80bdc1c..9d5cb4d91792f625219fb2042ecdf0e3ab2352d5 100644 (file)
@@ -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
index 56e197cb20b04a573d9fcbfab501b035bc797b1f..c25b409d7c05ed4e4e9c81eff473cebb85ae6979 100644 (file)
@@ -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)