()
| 86 | row_factory = getattr(rows, row_factory) |
| 87 | |
| 88 | def work(): |
| 89 | with conn_cls.connect(dsn) as conn, conn.transaction(force_rollback=True): |
| 90 | with psycopg.ClientCursor(conn, row_factory=row_factory) as cur: |
| 91 | cur.execute(faker.drop_stmt) |
| 92 | cur.execute(faker.create_stmt) |
| 93 | with faker.find_insert_problem(conn): |
| 94 | cur.executemany(faker.insert_stmt, faker.records) |
| 95 | cur.execute(faker.select_stmt) |
| 96 | |
| 97 | if fetch == "one": |
| 98 | while cur.fetchone() is not None: |
| 99 | pass |
| 100 | elif fetch == "many": |
| 101 | while cur.fetchmany(3): |
| 102 | pass |
| 103 | elif fetch == "all": |
| 104 | cur.fetchall() |
| 105 | elif fetch == "iter": |
| 106 | for rec in cur: |
| 107 | pass |
| 108 | |
| 109 | n = [] |
| 110 | gc.collect() |
no test coverage detected