emfcamp / Website

The Electromagnetic Field web site
http://www.emfcamp.org
GNU Affero General Public License v3.0
41 stars 84 forks source link

pytest warnings #1773

Open Kunsi opened 2 months ago

Kunsi commented 2 months ago

Noticed while preparing tests for #1770, pytest outputs a bunch of warnings:

================================================== warnings summary ===================================================
models/volunteer/shift.py:74
  /app/models/volunteer/shift.py:74: RemovedIn20Warning: Deprecated API features detected! These feature(s) are not compatible with SQLAlchemy 2.0. To prevent incompatible upgrades prior to updating applications, ensure requirements files are pinned to "sqlalchemy<2.0". Set environment variable SQLALCHEMY_WARN_20=1 to show all deprecation warnings.  Set environment variable SQLALCHEMY_SILENCE_UBER_WARNING=1 to silence this message. (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
    select([func.count(ShiftEntry.shift_id)]).where(ShiftEntry.shift_id == id).correlate_except(ShiftEntry).scalar_subquery()  # type: ignore[attr-defined,arg-type]

../root/.cache/pypoetry/virtualenvs/website-9TtSrW0h-py3.11/lib/python3.11/site-packages/dateutil/parser/_parser.py:1207: 1 warning
tests/test_cfp_sense_check.py: 15 warnings
  /root/.cache/pypoetry/virtualenvs/website-9TtSrW0h-py3.11/lib/python3.11/site-packages/dateutil/parser/_parser.py:1207: UnknownTimezoneWarning: tzname BST identified but not understood.  Pass `tzinfos` argument in order to correctly return a timezone-aware datetime.  In a future version, this will raise an exception.
    warnings.warn("tzname {tzname} identified but not understood.  "

tests/test_sql_query_count.py::test_query_count[/tickets-2]
  /root/.cache/pypoetry/virtualenvs/website-9TtSrW0h-py3.11/lib/python3.11/site-packages/flask_admin/contrib/__init__.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    __import__('pkg_resources').declare_namespace(__name__)

tests/test_sql_query_count.py::test_query_count[/tickets-2]
tests/test_sql_query_count.py::test_query_count[/tickets-2]
  /root/.cache/pypoetry/virtualenvs/website-9TtSrW0h-py3.11/lib/python3.11/site-packages/pkg_resources/__init__.py:2825: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('zope')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

tests/test_sql_query_count.py::test_query_count[/tickets-2]
  /root/.cache/pypoetry/virtualenvs/website-9TtSrW0h-py3.11/lib/python3.11/site-packages/flask_admin/contrib/__init__.py:2: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('flask_admin.contrib')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    __import__('pkg_resources').declare_namespace(__name__)

tests/test_sql_query_count.py::test_query_count[/tickets-2]
  /root/.cache/pypoetry/virtualenvs/website-9TtSrW0h-py3.11/lib/python3.11/site-packages/pkg_resources/__init__.py:2309: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('flask_admin')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(parent)
jayaddison commented 2 months ago

Yep, those are noisy - this appears to be due to some code in flask-admin 1.6.1 -- fortunately it appears to already be fixed by a subsequent change (https://github.com/pallets-eco/flask-admin/commit/124707318260e10a1d6a4a271fc31362269f2cb4) that should arrive in flask-admin v2.0.0.