From 2ed56e2a4bb1dbd0b8e41eac87df905c3ce98a38 Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Thu, 18 May 2023 23:02:51 +0200 Subject: [PATCH] fix: tests * remove unused imports * add nitpick_ignore * apply deprecation warnings for sphinx 8 in sphinx 7 * initialize InvenioI18N for tests --- docs/conf.py | 14 ++++++++------ tests/conftest.py | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 445ecb9..c8d0486 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,12 +9,8 @@ """Sphinx configuration.""" -from __future__ import print_function - import sys -import sphinx.environment - from invenio_oauth2server import __version__ # Plug example application into module path @@ -39,6 +35,12 @@ "sphinx.ext.viewcode", ] +nitpick_ignore = [ + ("py:class", "t.ClassVar"), + ("py:class", "Query"), + ("py:attr", "query_class"), +] + # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -55,7 +57,7 @@ # General information about the project. project = "Invenio-OAuth2Server" -copyright = "2017, CERN" +copyright = "2023, CERN" author = "CERN" # The version info for the project you're documenting, acts as replacement for @@ -327,7 +329,7 @@ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { - "https://docs.python.org/": None, + "python": ("https://docs.python.org/", None), "flask": ("https://flask.palletsprojects.com", None), } diff --git a/tests/conftest.py b/tests/conftest.py index 27b33a2..03c8906 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,7 +28,7 @@ from invenio_accounts.models import User from invenio_accounts.views import blueprint as accounts_blueprint from invenio_db import InvenioDB, db -from invenio_i18n import Babel +from invenio_i18n import Babel, InvenioI18N from six import get_method_self from sqlalchemy_utils.functions import create_database, database_exists, drop_database @@ -92,6 +92,7 @@ def init_app(app): Breadcrumbs(app) InvenioDB(app) InvenioOAuth2Server(app) + InvenioI18N(app) api_app = Flask("testapiapp", instance_path=instance_path) api_app.config.update(APPLICATION_ROOT="/api", ACCOUNTS_REGISTER_BLUEPRINT=True)