MCPcopy
hub / github.com/psycopg/psycopg / work

Function work

tests/test_cursor_client.py:88–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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()

Callers 1

test_leakFunction · 0.70

Calls 8

find_insert_problemMethod · 0.80
connectMethod · 0.45
transactionMethod · 0.45
executeMethod · 0.45
executemanyMethod · 0.45
fetchoneMethod · 0.45
fetchmanyMethod · 0.45
fetchallMethod · 0.45

Tested by

no test coverage detected