MCPcopy Create free account
hub / github.com/piccolo-orm/piccolo / asyncSetUp

Method asyncSetUp

piccolo/testing/test_case.py:112–121  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

110 db: Optional[Engine] = None
111
112 async def asyncSetUp(self) -> None:
113 db = self.db or engine_finder()
114 assert db is not None
115 self.transaction = db.transaction()
116
117 # This is only available in Python 3.11 and above:
118 await self.enterAsyncContext(cm=self.transaction) # type: ignore
119
120 if isinstance(self.transaction, CockroachTransaction):
121 await self.transaction.autocommit_before_ddl(False)
122
123 async def asyncTearDown(self):
124 await super().asyncTearDown()

Callers

nothing calls this directly

Calls 3

engine_finderFunction · 0.90
autocommit_before_ddlMethod · 0.80
transactionMethod · 0.45

Tested by

no test coverage detected