MCPcopy
hub / github.com/psycopg/psycopg / test_cursor_closed

Function test_cursor_closed

tests/test_connection.py:203–211  ·  view source on GitHub ↗
(conn)

Source from the content-addressed store, hash-verified

201
202
203def test_cursor_closed(conn):
204 conn.close()
205 with pytest.raises(psycopg.OperationalError):
206 with conn.cursor("foo"):
207 pass
208 with pytest.raises(psycopg.OperationalError):
209 conn.cursor("foo")
210 with pytest.raises(psycopg.OperationalError):
211 conn.cursor()
212
213
214# TODO: the INERROR started failing in the C implementation in Python 3.12a7

Callers

nothing calls this directly

Calls 2

closeMethod · 0.45
cursorMethod · 0.45

Tested by

no test coverage detected