(metadata, engine_or_connection)
| 370 | |
| 371 | |
| 372 | def drop_all_tables_from_metadata(metadata, engine_or_connection): |
| 373 | from . import engines |
| 374 | |
| 375 | def go(connection): |
| 376 | engines.testing_reaper.prepare_for_drop_tables(connection) |
| 377 | |
| 378 | if not connection.dialect.supports_alter: |
| 379 | from . import assertions |
| 380 | |
| 381 | with assertions.expect_warnings( |
| 382 | "Can't sort tables", assert_=False |
| 383 | ): |
| 384 | metadata.drop_all(connection) |
| 385 | else: |
| 386 | metadata.drop_all(connection) |
| 387 | |
| 388 | if not isinstance(engine_or_connection, Connection): |
| 389 | with engine_or_connection.begin() as connection: |
| 390 | go(connection) |
| 391 | else: |
| 392 | go(engine_or_connection) |
| 393 | |
| 394 | |
| 395 | def drop_all_tables( |
no test coverage detected