37 lines
1.7 KiB
Diff
37 lines
1.7 KiB
Diff
From e35abbef48a4cda2e376a7ff668961378f3c86cb Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
|
Date: Tue, 18 Mar 2025 12:54:57 +0100
|
|
Subject: [PATCH] Tests: Adjust expected exception message for Python 3.14.0a6
|
|
|
|
E AssertionError: Regex pattern did not match.
|
|
E Regex: '3 cannot cast to typing.Union\\[str, int\\]'
|
|
E Input: '3 cannot cast to str | int'
|
|
|
|
Change caused likely by https://github.com/python/cpython/commit/dc6d66f44c0a25b69dfec7e4ffc4a6fa5e4feada
|
|
---
|
|
docs/changelog/3500.bugfix.rst | 2 ++
|
|
tests/config/loader/test_str_convert.py | 2 +-
|
|
2 files changed, 3 insertions(+), 1 deletion(-)
|
|
create mode 100644 docs/changelog/3500.bugfix.rst
|
|
|
|
diff --git a/docs/changelog/3500.bugfix.rst b/docs/changelog/3500.bugfix.rst
|
|
new file mode 100644
|
|
index 000000000..9df1cf05d
|
|
--- /dev/null
|
|
+++ b/docs/changelog/3500.bugfix.rst
|
|
@@ -0,0 +1,2 @@
|
|
+Make tox tests pass with Python 3.14.0a6
|
|
+- by :user:`hroncok`
|
|
diff --git a/tests/config/loader/test_str_convert.py b/tests/config/loader/test_str_convert.py
|
|
index 8540e2105..b06929f48 100644
|
|
--- a/tests/config/loader/test_str_convert.py
|
|
+++ b/tests/config/loader/test_str_convert.py
|
|
@@ -77,7 +77,7 @@ def test_str_convert_ok_py39(raw: str, value: Any, of_type: type[Any]) -> None:
|
|
[
|
|
("a", TypeVar, TypeError, r"a cannot cast to .*typing.TypeVar.*"),
|
|
("3", Literal["1", "2"], ValueError, r"3 must be one of \('1', '2'\)"),
|
|
- ("3", Union[str, int], TypeError, r"3 cannot cast to typing.Union\[str, int\]"),
|
|
+ ("3", Union[str, int], TypeError, r"3 cannot cast to (typing.Union\[str, int\]|str \| int)"),
|
|
("", Command, ValueError, r"attempting to parse '' into a command failed"),
|
|
],
|
|
)
|