14
0
forked from pool/python-Sphinx
Files
python-Sphinx/typing.patch
Nico Krapp 053ce84ac8 - Add upstream patches to fix tests with Python 3.14:
* autodoc.patch
  * autosummary.patch
  * typing.patch
- Proactively add upstream patch to fix tests with docutils 0.22:
  * docutils022.patch
- Rename multibuild flavor 'test' to 'test+doc' to better reflect
  the current behaviour

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Sphinx?expand=0&rev=288
2025-09-12 08:04:55 +00:00

41 lines
1.5 KiB
Diff

From e01e42f5fc738815b8499c4ede30c6caf130f0a4 Mon Sep 17 00:00:00 2001
From: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Date: Wed, 19 Mar 2025 20:11:35 +0000
Subject: [PATCH] Fix ``INVALID_BUILTIN_CLASSES`` test for Python 3.14.0a6+
---
tests/test_util/test_util_typing.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/test_util/test_util_typing.py b/tests/test_util/test_util_typing.py
index 35ee240f7b8..8a561c378ed 100644
--- a/tests/test_util/test_util_typing.py
+++ b/tests/test_util/test_util_typing.py
@@ -205,7 +205,7 @@ def test_is_invalid_builtin_class() -> None:
zipfile.Path,
zipfile.CompleteDirs,
)
- if sys.version_info[:2] >= (3, 13):
+ if sys.version_info[:2] == (3, 13):
invalid_types += (
# pathlib
Path,
@@ -217,7 +217,7 @@ def test_is_invalid_builtin_class() -> None:
)
invalid_names = {(cls.__module__, cls.__qualname__) for cls in invalid_types}
- if sys.version_info[:2] < (3, 13):
+ if sys.version_info[:2] != (3, 13):
invalid_names |= {
('pathlib._local', 'Path'),
('pathlib._local', 'PosixPath'),
@@ -231,7 +231,7 @@ def test_is_invalid_builtin_class() -> None:
('zipfile._path', 'Path'),
('zipfile._path', 'CompleteDirs'),
}
- assert _INVALID_BUILTIN_CLASSES.keys() == invalid_names
+ assert set(_INVALID_BUILTIN_CLASSES) == invalid_names
def test_restify_type_hints_containers():