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

Function decorate

lib/sqlalchemy/testing/util.py:365–377  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

363 """Provide MetaData for a pytest fixture."""
364
365 def decorate(fn):
366 def run_ddl(self):
367 metadata = self.metadata = schema.MetaData()
368 try:
369 result = fn(self, metadata)
370 metadata.create_all(config.db)
371 # TODO:
372 # somehow get a per-function dml erase fixture here
373 yield result
374 finally:
375 metadata.drop_all(config.db)
376
377 return config.fixture(scope=ddl)(run_ddl)
378
379 return decorate
380

Callers 1

__call__Method · 0.70

Calls 2

fixtureMethod · 0.45
_clearMethod · 0.45

Tested by

no test coverage detected