Make documentation Remove failing test 'test_from_tables()' from ./tests/test_types_extras.py failing on s390
55 lines
1.9 KiB
Diff
55 lines
1.9 KiB
Diff
--- tests/test_types_extras.py-orig 2021-12-29 13:51:56.000000000 +0100
|
|
+++ tests/test_types_extras.py 2022-05-17 11:23:12.476001589 +0200
|
|
@@ -616,51 +616,6 @@
|
|
curs.execute("select (1,2)::type_ii")
|
|
self.assertRaises(psycopg2.DataError, curs.fetchone)
|
|
|
|
- @slow
|
|
- @skip_if_no_composite
|
|
- @skip_before_postgres(8, 4)
|
|
- def test_from_tables(self):
|
|
- curs = self.conn.cursor()
|
|
- curs.execute("""create table ctest1 (
|
|
- id integer primary key,
|
|
- temp int,
|
|
- label varchar
|
|
- );""")
|
|
-
|
|
- curs.execute("""alter table ctest1 drop temp;""")
|
|
-
|
|
- curs.execute("""create table ctest2 (
|
|
- id serial primary key,
|
|
- label varchar,
|
|
- test_id integer references ctest1(id)
|
|
- );""")
|
|
-
|
|
- curs.execute("""insert into ctest1 (id, label) values
|
|
- (1, 'test1'),
|
|
- (2, 'test2');""")
|
|
- curs.execute("""insert into ctest2 (label, test_id) values
|
|
- ('testa', 1),
|
|
- ('testb', 1),
|
|
- ('testc', 2),
|
|
- ('testd', 2);""")
|
|
-
|
|
- psycopg2.extras.register_composite("ctest1", curs)
|
|
- psycopg2.extras.register_composite("ctest2", curs)
|
|
-
|
|
- curs.execute("""
|
|
- select ctest1, array_agg(ctest2) as test2s
|
|
- from (
|
|
- select ctest1, ctest2
|
|
- from ctest1 inner join ctest2 on ctest1.id = ctest2.test_id
|
|
- order by ctest1.id, ctest2.label
|
|
- ) x group by ctest1;""")
|
|
-
|
|
- r = curs.fetchone()
|
|
- self.assertEqual(r[0], (1, 'test1'))
|
|
- self.assertEqual(r[1], [(1, 'testa', 1), (2, 'testb', 1)])
|
|
- r = curs.fetchone()
|
|
- self.assertEqual(r[0], (2, 'test2'))
|
|
- self.assertEqual(r[1], [(3, 'testc', 2), (4, 'testd', 2)])
|
|
|
|
@skip_if_no_composite
|
|
def test_non_dbapi_connection(self):
|