examples.
"""
+ if schema is not None and not isinstance(schema, str):
+ raise exc.ArgumentError(
+ "expected schema argument to be a string, "
+ f"got {type(schema)}."
+ )
self.tables = util.FacadeDict()
self.schema = quoted_name.construct(schema, quote_schema)
self.naming_convention = (
):
eq_(repr(const), exp)
+ @testing.variation("kind", ["engine", "conn", "something"])
+ def test_metadata_bind(self, connection, kind):
+ with expect_raises_message(
+ exc.ArgumentError,
+ "expected schema argument to be a string, got",
+ ):
+ if kind.engine:
+ MetaData(connection.engine)
+ elif kind.conn:
+ MetaData(connection)
+ else:
+ MetaData(42) # type: ignore
+
class ToMetaDataTest(fixtures.TestBase, AssertsCompiledSQL, ComparesTables):
@testing.requires.check_constraints