From 0aea2ac90344d5fbe39df2125d6885ddd5837f89 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 15 Jul 2021 10:42:06 +0100 Subject: [PATCH] tests: Silence SQLAlchemy warnings While we wait for keystone to merge the patch to unblock oslo.db 10.0.0, silence these warnings from newer versions of SQLAlchemy. TODOs are left since we don't want to keep these around forever. Change-Id: If48dd949ec4d69a09c87178f16d56a2517e21fd8 Signed-off-by: Stephen Finucane --- nova/tests/fixtures/nova.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/nova/tests/fixtures/nova.py b/nova/tests/fixtures/nova.py index 5f88dec74b..f7e4a68d5b 100644 --- a/nova/tests/fixtures/nova.py +++ b/nova/tests/fixtures/nova.py @@ -770,6 +770,28 @@ class WarningsFixture(fixtures.Fixture): 'error', message='Evaluating non-mapped column expression', category=sqla_exc.SAWarning) + # NOTE(stephenfin): Disable the annoying "TypeDecorator foo will not + # produce a cache key because the ``cache_ok`` flag is not set to True" + # warning. It's fixed in oslo.db 10.0.0 but not before. + # TODO(stephenfin): Remove once we bump oslo.db in lower-constraints to + # 10.0.0 + warnings.filterwarnings( + 'ignore', + message=r'TypeDecorator SoftDeleteInteger\(\) will not produce .*', + category=sqla_exc.SAWarning) + + # TODO(stephenfin): Remove once we fix this is oslo.db 10.0.1 or so + warnings.filterwarnings( + 'ignore', + message=r'Invoking and_\(\) without arguments is deprecated, .*', + category=sqla_exc.SADeprecationWarning) + + # TODO(stephenfin): Remove once we fix this in placement 5.0.2 or 6.0.0 + warnings.filterwarnings( + 'ignore', + message='Implicit coercion of SELECT and textual SELECT .*', + category=sqla_exc.SADeprecationWarning) + # TODO(jangutter): Change (or remove) this to an error during the Train # cycle when the os-vif port profile is no longer used. warnings.filterwarnings(