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

Method test_metadata_drop_both

test/engine/test_ddlevents.py:330–357  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

328 )
329
330 def test_metadata_drop_both(self):
331 metadata, bind = self.metadata, self.bind
332 canary = mock.Mock()
333
334 event.listen(metadata, "before_drop", canary.before_drop)
335 event.listen(metadata, "after_drop", canary.after_drop)
336
337 metadata.create_all(bind)
338 metadata.drop_all(bind)
339 eq_(
340 canary.mock_calls,
341 [
342 mock.call.before_drop(
343 metadata,
344 self.bind,
345 checkfirst=False,
346 tables=list(metadata.tables.values()),
347 _ddl_runner=mock.ANY,
348 ),
349 mock.call.after_drop(
350 metadata,
351 self.bind,
352 checkfirst=False,
353 tables=list(metadata.tables.values()),
354 _ddl_runner=mock.ANY,
355 ),
356 ],
357 )
358
359 def test_metadata_table_isolation(self):
360 metadata, table = self.metadata, self.table

Callers

nothing calls this directly

Calls 7

eq_Function · 0.90
create_allMethod · 0.80
drop_allMethod · 0.80
before_dropMethod · 0.80
after_dropMethod · 0.80
listenMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected