(cls, subject: _TConsSubject)
| 105 | |
| 106 | @classmethod |
| 107 | def _trans_ctx_check(cls, subject: _TConsSubject) -> None: |
| 108 | trans_context = subject._trans_context_manager |
| 109 | if trans_context: |
| 110 | if not trans_context._transaction_is_active(): |
| 111 | raise exc.InvalidRequestError( |
| 112 | "Can't operate on closed transaction inside context " |
| 113 | "manager. Please complete the context manager " |
| 114 | "before emitting further commands." |
| 115 | ) |
| 116 | |
| 117 | def __enter__(self) -> Self: |
| 118 | subject = self._get_subject() |
no test coverage detected