| 292 | |
| 293 | @define_test |
| 294 | def reflect_whole_tables( |
| 295 | engine, schema_name, table_names, timing, mode, ignore_diff |
| 296 | ): |
| 297 | single = None |
| 298 | meta = sa.MetaData(schema=schema_name) |
| 299 | |
| 300 | if "single" in mode: |
| 301 | |
| 302 | def go(bind): |
| 303 | single = {} |
| 304 | with timing("Table_autoload_with"): |
| 305 | for name in table_names: |
| 306 | single[(None, name)] = sa.Table( |
| 307 | name, meta, autoload_with=bind |
| 308 | ) |
| 309 | return single |
| 310 | |
| 311 | if USE_CONNECTION: |
| 312 | with engine.connect() as c: |
| 313 | single = go(c) |
| 314 | else: |
| 315 | single = go(engine) |
| 316 | |
| 317 | multi_meta = sa.MetaData(schema=schema_name) |
| 318 | if "multi" in mode: |
| 319 | with timing("MetaData_reflect"): |
| 320 | multi_meta.reflect(engine, only=table_names) |
| 321 | return (multi_meta, single) |
| 322 | |
| 323 | |
| 324 | @define_test |