diff --git a/exec-tests b/exec-tests index 51118bf25c..af96d01088 100755 --- a/exec-tests +++ b/exec-tests @@ -153,7 +153,12 @@ if [[ "${subtst:-python}" == "python" ]]; then printf -- "\n\n\nRunning %s python3-based unit tests via pytest\n\n" "${major_list// /,}" _pbench_sources=$(python3 -c 'import inspect, pathlib, pbench; print(pathlib.Path(inspect.getsourcefile(pbench)).parent)') - PYTHONUNBUFFERED=True _PBENCH_COV_DIR="${_toxenvdir}/cov" ${_ECHO} _time pytest \ + # We use SQLALCHEMY_SILENCE_UBER_WARNING here to silence very prolific + # warnings posted by SQLAlchemy 1.4.x about features / behaviors being + # used which are not compatible with SQLAlchemy 2.x. Since we are not + # going to switch to 2.x any time soon, we use the big hammer approach + # to avoid the noise. + SQLALCHEMY_SILENCE_UBER_WARNING=1 PYTHONUNBUFFERED=True _PBENCH_COV_DIR="${_toxenvdir}/cov" ${_ECHO} _time pytest \ --tb=native \ ${pytest_jobs_arg} \ --basetemp="${_toxenvdir}/tmp" \ @@ -226,7 +231,8 @@ if [[ "${major}" == "all" || "${major}" == "server" ]]; then server_arg=${1} shift posargs="${@}" - PYTHONUNBUFFERED=True PBENCH_SERVER=${server_arg} pytest --tb=native -v -s ${posargs} --pyargs pbench.test.functional.server + # We use SQLALCHEMY_SILENCE_UBER_WARNING here ... (see above). + SQLALCHEMY_SILENCE_UBER_WARNING=1 PYTHONUNBUFFERED=True PBENCH_SERVER=${server_arg} pytest --tb=native -v -s ${posargs} --pyargs pbench.test.functional.server rc=${?} fi fi diff --git a/lib/pbench/server/database/database.py b/lib/pbench/server/database/database.py index 7538cf95ea..2593cb08d2 100644 --- a/lib/pbench/server/database/database.py +++ b/lib/pbench/server/database/database.py @@ -1,8 +1,7 @@ import sys from sqlalchemy import create_engine -from sqlalchemy.ext.declarative import declarative_base -from sqlalchemy.orm import scoped_session, sessionmaker +from sqlalchemy.orm import declarative_base, scoped_session, sessionmaker from pbench.server import NoOptionError, NoSectionError diff --git a/pytest.ini b/pytest.ini index 5f5077f4d7..c984c40d2f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,3 +2,8 @@ addopts = -s log_cli=False log_level=DEBUG +filterwarnings= + # Issue #557 in `pytest-cov` (currently v4.x) has not moved for a while now, + # but once a resolution has been adopted we can drop this "ignore". + # Ref: https://github.com/pytest-dev/pytest-cov/issues/557 + ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning