mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-08-29 02:26:59 +08:00
243b1a0735
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.
8 lines
215 B
Python
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")
|