| 92 | @pytest.mark.parametrize("format", pq.Format) |
| 93 | @pytest.mark.parametrize("typetype", ["names", "oids"]) |
| 94 | def test_read_rows(conn, format, typetype): |
| 95 | cur = conn.cursor() |
| 96 | with cur.copy(""" |
| 97 | copy ( |
| 98 | select 10::int4, 'hello'::text, '{0.0,1.0}'::float8[] |
| 99 | ) to stdout (format %s)""" % format.name) as copy: |
| 100 | copy.set_types(["int4", "text", "float8[]"]) |
| 101 | row = copy.read_row() |
| 102 | assert copy.read_row() is None |
| 103 | |
| 104 | assert row == (10, "hello", [0.0, 1.0]) |
| 105 | assert conn.info.transaction_status == pq.TransactionStatus.INTRANS |
| 106 | |
| 107 | |
| 108 | @pytest.mark.parametrize("format", pq.Format) |