]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Some unit test fixes regarding numeric arrays,
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Jun 2011 00:22:20 +0000 (20:22 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 5 Jun 2011 00:22:20 +0000 (20:22 -0400)
MATCH operator.   A potential floating-point
inaccuracy issue was fixed, and certain tests
of the MATCH operator only execute within an
EN-oriented locale for now.  [ticket:2175].

CHANGES
lib/sqlalchemy/test/requires.py
test/dialect/test_postgresql.py

diff --git a/CHANGES b/CHANGES
index 545d79bc9a558dcfb420136d74f7234b362f7857..1f86681fe5011e41f2f8c09c335eecbd1e3d4f89 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -75,6 +75,12 @@ CHANGES
     would fail if against a column whose name
     had changed.  [ticket:2141].
 
+  - Some unit test fixes regarding numeric arrays, 
+    MATCH operator.   A potential floating-point
+    inaccuracy issue was fixed, and certain tests 
+    of the MATCH operator only execute within an 
+    EN-oriented locale for now.  [ticket:2175].  
+
 - mssql
   - Fixed bug in MSSQL dialect whereby the aliasing
     applied to a schema-qualified table would leak
index 084eca329da19fa4af19caa72c6f8444cf0a9ef3..92dc6186dc21e857290f9060e740a1abb46683d5 100644 (file)
@@ -331,3 +331,9 @@ def sqlite(fn):
         skip_if(lambda: not _has_sqlite())
     )
 
+def english_locale_on_postgresql(fn):
+    return _chain_decorators_on(
+        fn,
+        skip_if(lambda: testing.against('postgresql') \
+                and not testing.db.scalar('SHOW LC_COLLATE').startswith('en'))
+    )
index 18c4477ac73f69305d493cc1ca13a930e3a2d4e8..928722993465fb64d8c86b0518857f817f3a730c 100644 (file)
@@ -289,7 +289,7 @@ class FloatCoercionTest(TablesTest, AssertsExecutionResults):
             Column('q', postgresql.ARRAY(Numeric))
         )
         metadata.create_all()
-        t1.insert().execute(x=[5], y=[5], z=[6], q=[6.4])
+        t1.insert().execute(x=[5], y=[5], z=[6], q=[decimal.Decimal("6.4")])
         row = t1.select().execute().first()
         eq_(
             row, 
@@ -2129,12 +2129,14 @@ class MatchTest(TestBase, AssertsCompiledSQL):
                 )).execute().fetchall()
         eq_([3], [r.id for r in results])
 
+    @testing.requires.english_locale_on_postgresql
     def test_simple_derivative_match(self):
         results = \
             matchtable.select().where(matchtable.c.title.match('nutshells'
                 )).execute().fetchall()
         eq_([5], [r.id for r in results])
 
+    @testing.requires.english_locale_on_postgresql
     def test_or_match(self):
         results1 = \
             matchtable.select().where(or_(matchtable.c.title.match('nutshells'
@@ -2147,6 +2149,7 @@ class MatchTest(TestBase, AssertsCompiledSQL):
                 )).order_by(matchtable.c.id).execute().fetchall()
         eq_([3, 5], [r.id for r in results2])
 
+    @testing.requires.english_locale_on_postgresql
     def test_and_match(self):
         results1 = \
             matchtable.select().where(and_(matchtable.c.title.match('python'
@@ -2159,6 +2162,7 @@ class MatchTest(TestBase, AssertsCompiledSQL):
                 )).execute().fetchall()
         eq_([5], [r.id for r in results2])
 
+    @testing.requires.english_locale_on_postgresql
     def test_match_across_joins(self):
         results = matchtable.select().where(and_(cattable.c.id
                 == matchtable.c.category_id,