Return the values inserted in the test table.
(conn)
| 35 | |
| 36 | |
| 37 | def inserted(conn): |
| 38 | """Return the values inserted in the test table.""" |
| 39 | sql = "SELECT * FROM test_table" |
| 40 | if isinstance(conn, psycopg.Connection): |
| 41 | rows = conn.cursor().execute(sql).fetchall() |
| 42 | return {v for (v,) in rows} |
| 43 | else: |
| 44 | |
| 45 | async def f(): |
| 46 | cur = conn.cursor() |
| 47 | await cur.execute(sql) |
| 48 | rows = await cur.fetchall() |
| 49 | return {v for (v,) in rows} |
| 50 | |
| 51 | return f() |
| 52 | |
| 53 | |
| 54 | def in_transaction(conn): |
no test coverage detected