diff --git a/placement/tests/functional/fixtures/capture.py b/placement/tests/functional/fixtures/capture.py index 118750ca8..c58119acf 100644 --- a/placement/tests/functional/fixtures/capture.py +++ b/placement/tests/functional/fixtures/capture.py @@ -91,11 +91,16 @@ class WarningsFixture(fixtures.Fixture): message='Evaluating non-mapped column expression', category=sqla_exc.SAWarning) + # Configure SQLAlchemy 2.0 warnings # TODO(stephenfin): Remove once we're using sqlalchemy 2.0 which should - # remove this functionality entirely + # remove these deprecated features entirely + warnings.filterwarnings( + 'ignore', + category=sqla_exc.SADeprecationWarning) + warnings.filterwarnings( 'error', - message='Implicit coercion of SELECT and textual SELECT .*', + module='placement', category=sqla_exc.SADeprecationWarning) self.addCleanup(self._reset_warning_filters) diff --git a/tox.ini b/tox.ini index dd0fd1b8b..4d25b8df6 100644 --- a/tox.ini +++ b/tox.ini @@ -23,6 +23,8 @@ setenv = OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=160 PYTHONDONTWRITEBYTECODE=1 +# TODO(stephenfin): Remove once we bump our upper-constraint to SQLAlchemy 2.0 + SQLALCHEMY_WARN_20=1 deps = -r{toxinidir}/test-requirements.txt # For a venv that doesn't use stestr commands must be overridden. commands =