diff options
Diffstat (limited to 'oslo_db')
-rw-r--r-- | oslo_db/sqlalchemy/provision.py | 3 | ||||
-rw-r--r-- | oslo_db/tests/fixtures.py | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/oslo_db/sqlalchemy/provision.py b/oslo_db/sqlalchemy/provision.py index 4bce257..21eb90a 100644 --- a/oslo_db/sqlalchemy/provision.py +++ b/oslo_db/sqlalchemy/provision.py @@ -579,8 +579,7 @@ class SQLiteBackendImpl(BackendImpl): @BackendImpl.impl.dispatch_for("postgresql") class PostgresqlBackendImpl(BackendImpl): def create_opportunistic_driver_url(self): - return "postgresql://openstack_citest:openstack_citest"\ - "@localhost/postgres" + return "postgresql+psycopg2://openstack_citest:openstack_citest@localhost/postgres" # noqa: E501 def create_named_database(self, engine, ident, conditional=False): with engine.connect().execution_options( diff --git a/oslo_db/tests/fixtures.py b/oslo_db/tests/fixtures.py index 502719b..acc260d 100644 --- a/oslo_db/tests/fixtures.py +++ b/oslo_db/tests/fixtures.py @@ -21,6 +21,9 @@ class WarningsFixture(fixtures.Fixture): def setUp(self): super().setUp() + + self._original_warning_filters = warnings.filters[:] + # Make deprecation warnings only happen once to avoid spamming warnings.simplefilter('once', DeprecationWarning) @@ -75,4 +78,7 @@ class WarningsFixture(fixtures.Fixture): module='migrate', category=sqla_exc.SADeprecationWarning) - self.addCleanup(warnings.resetwarnings) + self.addCleanup(self._reset_warning_filters) + + def _reset_warning_filters(self): + warnings.filters[:] = self._original_warning_filters |