From: Mike Bayer Date: Mon, 21 Dec 2020 20:04:32 +0000 (-0500) Subject: use private alembic name for fixture metadata X-Git-Tag: rel_1_5_0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c78c71ff8a57a305fe9324bf48d230e19acdccc;p=thirdparty%2Fsqlalchemy%2Falembic.git use private alembic name for fixture metadata assigning self.metadata conflicts with fixtures in SQLAlchemy inlcuding a class level method we hope to add. Change-Id: Ifebb654268f5e4a13643adf79acb2e7c3df08b05 --- diff --git a/tests/_autogen_fixtures.py b/tests/_autogen_fixtures.py index 29169627..e81eb5d2 100644 --- a/tests/_autogen_fixtures.py +++ b/tests/_autogen_fixtures.py @@ -274,8 +274,8 @@ class AutogenFixtureTest(_ComparesFKs): dialect._user_defined_max_identifier_length ) = max_identifier_length try: - self.metadata, model_metadata = m1, m2 - for m in util.to_list(self.metadata): + self._alembic_metadata, model_metadata = m1, m2 + for m in util.to_list(self._alembic_metadata): m.create_all(self.bind) with self.bind.connect() as conn: @@ -318,7 +318,7 @@ class AutogenFixtureTest(_ComparesFKs): self.bind = config.db def tearDown(self): - if hasattr(self, "metadata"): - for m in util.to_list(self.metadata): + if hasattr(self, "_alembic_metadata"): + for m in util.to_list(self._alembic_metadata): m.drop_all(self.bind) clear_staging_env()