1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
Description: Fix tests/common.py
This patch fixes a few issues with the newer versions of Sphinx.
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Bug-Debian: https://bugs.debian.org/1114333
Last-Update: 2025-10-24
Index: python-sphinx-code-include/tests/common.py
===================================================================
--- python-sphinx-code-include.orig/tests/common.py
+++ python-sphinx-code-include/tests/common.py
@@ -7,6 +7,7 @@ from __future__ import annotations
import typing
import warnings
+from pathlib import Path
from unittest import mock
from docutils import statemachine
@@ -86,12 +87,15 @@ def load_cache(path: str) -> Inventory:
"""A fake set of settings for intersphinx to pass-through."""
intersphinx_timeout = None # type: int
+ intersphinx_cache_limit = 5
tls_verify = False
+ tls_cacerts = None
+ user_agent = ""
class MockApplication(object): # pylint: disable=too-few-public-methods
"""A fake state machine for intersphinx to consume and pass-through."""
- srcdir = ""
+ srcdir = Path("")
config = MockConfiguration()
@staticmethod
@@ -134,6 +138,7 @@ def load_cache_from_url(url: str) -> Inv
"""A fake set of settings for intersphinx to pass-through."""
intersphinx_timeout = None # type: int
+ intersphinx_cache_limit = 5
tls_cacerts = "" # Needed for Python 3.10+
tls_verify = False
user_agent = ""
@@ -141,7 +146,7 @@ def load_cache_from_url(url: str) -> Inv
class MockApplication(object): # pylint: disable=too-few-public-methods
"""A fake state machine for intersphinx to consume and pass-through."""
- srcdir = ""
+ srcdir = Path("")
config = MockConfiguration()
@staticmethod
|