MCPcopy
hub / github.com/psycopg/psycopg / close

Method close

tests/pool/test_pool.py:1011–1019  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1009 """
1010
1011 def close(self) -> None:
1012 if pool := getattr(self, "_pool", None):
1013 # Connection currently checked out from the pool.
1014 # Instead of closing it, return it to the pool.
1015 pool.putconn(self)
1016 else:
1017 # Connection not part of any pool, or currently into the pool.
1018 # Close the connection for real.
1019 super().close()
1020
1021
1022def test_override_close(dsn):

Callers 15

test_connectFunction · 0.45
test_closeFunction · 0.45
test_brokenFunction · 0.45
test_cursor_closedFunction · 0.45
test_context_closeFunction · 0.45
test_weakrefFunction · 0.45
test_commitFunction · 0.45
test_rollbackFunction · 0.45
test_autocommit_connectFunction · 0.45
test_autocommit_unknownFunction · 0.45

Calls 1

putconnMethod · 0.45

Tested by

no test coverage detected