MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_metadata_drop_both

Method test_metadata_drop_both

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

Source from the content-addressed store, hash-verified

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