Mike Bayer avatar Mike Bayer committed 38f6c1b

- backport test fixes from 0.8 to support newer postgresql, psycopg2 versions

Comments (0)

Files changed (4)

test/engine/test_execute.py

     def test_stmt_exception_pickleable_no_dbapi(self):
         self._test_stmt_exception_pickleable(Exception("hello world"))
 
-    @testing.fails_on("postgresql+psycopg2",
-                "Packages the cursor in the exception")
+    @testing.crashes("postgresql+psycopg2",
+                "Older versions dont support cursor pickling, newer ones do")
     @testing.fails_on("mysql+oursql",
                 "Exception doesn't come back exactly the same from pickle")
     @testing.fails_on("oracle+cx_oracle",

test/orm/inheritance/test_abc_polymorphic.py

 from test.lib.util import function_named
 from test.lib import fixtures
 from test.orm import _fixtures
+from test.lib.testing import eq_
 from test.lib.schema import Table, Column
 
 class ABCTest(fixtures.MappedTest):
 
             #for obj in sess.query(A).all():
             #    print obj
-            assert [
+            eq_(
+                [
                 A(adata='a1'),
                 B(bdata='b1', adata='b1'),
                 B(bdata='b2', adata='b2'),
                 C(cdata='c1', bdata='c1', adata='c1'),
                 C(cdata='c2', bdata='c2', adata='c2'),
                 C(cdata='c2', bdata='c2', adata='c2'),
-            ] == sess.query(A).order_by(A.id).all()
+            ], sess.query(A).order_by(A.id).all())
 
-            assert [
+            eq_([
                 B(bdata='b1', adata='b1'),
                 B(bdata='b2', adata='b2'),
                 B(bdata='b3', adata='b3'),
                 C(cdata='c1', bdata='c1', adata='c1'),
                 C(cdata='c2', bdata='c2', adata='c2'),
                 C(cdata='c2', bdata='c2', adata='c2'),
-            ] == sess.query(B).all()
+            ], sess.query(B).order_by(A.id).all())
 
-            assert [
+            eq_([
                 C(cdata='c1', bdata='c1', adata='c1'),
                 C(cdata='c2', bdata='c2', adata='c2'),
                 C(cdata='c2', bdata='c2', adata='c2'),
-            ] == sess.query(C).all()
+            ], sess.query(C).order_by(A.id).all())
 
         test_roundtrip = function_named(
             test_roundtrip, 'test_%s' % fetchtype)

test/orm/test_eager_relations.py

         sess = create_session()
 
         for q in [
-            sess.query(Address).filter(Address.id.in_([1, 4, 5])),
-            sess.query(Address).filter(Address.id.in_([1, 4, 5])).limit(3)
+            sess.query(Address).filter(Address.id.in_([1, 4, 5])).order_by(Address.id),
+            sess.query(Address).filter(Address.id.in_([1, 4, 5])).order_by(Address.id).limit(3)
         ]:
             sess.expunge_all()
             eq_(q.all(),
         sa.orm.clear_mappers()
 
         mapper(User, users, properties={
-            'addresses':relationship(Address, lazy='joined')})
+            'addresses':relationship(Address, lazy='joined',
+                            order_by=addresses.c.id)})
         mapper(Address, addresses, properties={
             'user_id':deferred(addresses.c.user_id),
             'dingalings':relationship(Dingaling, lazy='joined')})

test/sql/test_query.py

                     ), [(3,)]),
             (select([users.c.user_id]).\
                     where(
-                        users.c.user_name.contains('i % t', escape='\\')
+                        users.c.user_name.contains('i % t', escape='&')
                     ), [(5,)]),
         ):
             eq_(expr.execute().fetchall(), result)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.