From 7c78c71ff8a57a305fe9324bf48d230e19acdccc Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 21 Dec 2020 15:04:32 -0500 Subject: [PATCH] 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 --- tests/_autogen_fixtures.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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() -- 2.47.2