MCPcopy
hub / github.com/psycopg/psycopg / test_cancel_conn_finished

Function test_cancel_conn_finished

tests/pq/test_pgconn.py:520–532  ·  view source on GitHub ↗
(pgconn)

Source from the content-addressed store, hash-verified

518
519@pytest.mark.libpq(">= 17")
520def test_cancel_conn_finished(pgconn):
521 cancel_conn = pgconn.cancel_conn()
522 cancel_conn.reset()
523 cancel_conn.finish()
524 with pytest.raises(psycopg.OperationalError):
525 cancel_conn.start()
526 with pytest.raises(psycopg.OperationalError):
527 cancel_conn.blocking()
528 with pytest.raises(psycopg.OperationalError):
529 cancel_conn.poll()
530 with pytest.raises(psycopg.OperationalError):
531 cancel_conn.reset()
532 assert cancel_conn.get_error_message() == "connection pointer is NULL"
533
534
535def test_cancel(pgconn):

Callers

nothing calls this directly

Calls 7

cancel_connMethod · 0.45
resetMethod · 0.45
finishMethod · 0.45
startMethod · 0.45
blockingMethod · 0.45
pollMethod · 0.45
get_error_messageMethod · 0.45

Tested by

no test coverage detected