(conn, format, use_set_types)
| 134 | @pytest.mark.parametrize("format", pq.Format) |
| 135 | @pytest.mark.parametrize("use_set_types", [True, False]) |
| 136 | def test_rowlen_mismatch(conn, format, use_set_types): |
| 137 | samples = [["foo", "bar"], ["foo", "bar", "baz"]] |
| 138 | cur = conn.cursor() |
| 139 | ensure_table(cur, "id serial primary key, data text, data2 text") |
| 140 | with pytest.raises(psycopg.DataError): |
| 141 | with cur.copy( |
| 142 | f"copy copy_in (data, data2) from stdin (format {format.name})" |
| 143 | ) as copy: |
| 144 | if use_set_types: |
| 145 | copy.set_types(["text", "text"]) |
| 146 | for row in samples: |
| 147 | copy.write_row(row) |
| 148 | |
| 149 | |
| 150 | def test_set_custom_type(conn, hstore): |
nothing calls this directly
no test coverage detected