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
|
From: Adam Turner <9087854+aa-turner@users.noreply.github.com>
Date: Wed, 19 Mar 2025 20:11:35 +0000
Subject: Fix ``INVALID_BUILTIN_CLASSES`` test for Python 3.14.0a6+
(cherry picked from commit e01e42f5fc738815b8499c4ede30c6caf130f0a4)
---
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 35ee240..8a561c3 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():
|