tox: Enable SQLAlchemy 2.0 warnings
As described in [1]. Unfortunately it doesn't seem to be possible to silence these for other modules (cough...oslo.db...cough), presumably due to how SQLAlchemy has configured warnings. We'll have to ignore these for now. [1] https://docs.sqlalchemy.org/en/14/changelog/migration_20.html Change-Id: I28bc91d515440553828976dd1d3a3aef36a6d6a9 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
parent
13bbdba06d
commit
20fdc44bfd
@ -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)
|
||||
|
2
tox.ini
2
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 =
|
||||
|
Loading…
Reference in New Issue
Block a user