jarun / buku

:bookmark: Personal mini-web in text
GNU General Public License v3.0
6.52k stars 294 forks source link

CI tests failing on master (…again) #698

Closed LeXofLeviafan closed 1 year ago

LeXofLeviafan commented 1 year ago

When running tests locally via tox on a clean venv, the unit tests fail during initialization, apparently due to another dependency versions conflict.

(error log) ``` ImportError while importing test module '/home/lex/Work/buku/tests/test_views.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: .tox/python311/lib/python3.11/site-packages/_pytest/python.py:617: in _importtestmodule mod = import_path(self.path, mode=importmode, root=self.config.rootpath) .tox/python311/lib/python3.11/site-packages/_pytest/pathlib.py:567: in import_path importlib.import_module(module_name) /usr/lib/python3.11/importlib/__init__.py:126: in import_module return _bootstrap._gcd_import(name[level:], package, level) :1204: in _gcd_import ??? :1176: in _find_and_load ??? :1147: in _find_and_load_unlocked ??? :690: in _load_unlocked ??? .tox/python311/lib/python3.11/site-packages/_pytest/assertion/rewrite.py:178: in exec_module exec(co, module.__dict__) tests/test_views.py:13: in from bukuserver import server bukuserver/server.py:11: in from flask_api import FlaskAPI, status .tox/python311/lib/python3.11/site-packages/flask_api/__init__.py:1: in from flask_api.app import FlaskAPI .tox/python311/lib/python3.11/site-packages/flask_api/app.py:10: in from flask_api.request import APIRequest .tox/python311/lib/python3.11/site-packages/flask_api/request.py:5: in from werkzeug.urls import url_decode_stream E ImportError: cannot import name 'url_decode_stream' from 'werkzeug.urls' ```

The same error happens in CI as well.


Also, pylint prints warnings about using return within finally: block (here and here); which is understandable considering the dubious behaviour of such combinations. I believe these should be moved out of their respective finally: blocks.

(…There's also a warning about “inconsistent return statements,” but it goes away once return-in-finally is fixed.)

LeXofLeviafan commented 1 year ago

…The error was caused by this issue in Flask-API.