MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _checkin_event_fixture

Method _checkin_event_fixture

test/engine/test_pool.py:474–499  ·  view source on GitHub ↗
(self, _is_asyncio=False, _has_terminate=False)

Source from the content-addressed store, hash-verified

472 return p, canary
473
474 def _checkin_event_fixture(self, _is_asyncio=False, _has_terminate=False):
475 p = self._queuepool_fixture(
476 _is_asyncio=_is_asyncio, _has_terminate=_has_terminate
477 )
478 canary = []
479
480 @event.listens_for(p, "reset")
481 def reset(conn, rec, state):
482 canary.append(
483 "reset_"
484 f"{'rollback_ok' if state.asyncio_safe else 'no_rollback'}"
485 )
486
487 @event.listens_for(p, "checkin")
488 def checkin(*arg, **kw):
489 canary.append("checkin")
490
491 @event.listens_for(p, "close_detached")
492 def close_detached(*arg, **kw):
493 canary.append("close_detached")
494
495 @event.listens_for(p, "detach")
496 def detach(*arg, **kw):
497 canary.append("detach")
498
499 return p, canary
500
501 def _reset_event_fixture(self):
502 p = self._queuepool_fixture()

Calls 1

_queuepool_fixtureMethod · 0.80

Tested by

no test coverage detected