Files
galaxy/conftest.py
T
mvdbeek 243b1a0735 Move SAWarning filter to conftest.py for environments without SQLAlchemy
The error::sqlalchemy.exc.SAWarning filter in pytest.ini crashes on
Python 3.8 package tests where sqlalchemy isn't installed — older
pytest versions raise ModuleNotFoundError instead of logging a warning.

Move the filter to a root conftest.py using pytest_configure, which
conditionally adds it only when sqlalchemy is importable.
2026-04-12 11:38:52 +02:00

8 lines
215 B
Python

def pytest_configure(config):
try:
import sqlalchemy.exc # noqa: F401
except ImportError:
pass
else:
config.addinivalue_line("filterwarnings", "error::sqlalchemy.exc.SAWarning")