Skip to content

Commit beba4be

Browse files
authored
Tests: Adjust expected exception message for Python 3.14.0a6 (#3500)
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 python/cpython@dc6d66f
1 parent 794e6be commit beba4be

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/changelog/3500.bugfix.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Make tox tests pass with Python 3.14.0a6
2+
- by :user:`hroncok`

tests/config/loader/test_str_convert.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def test_str_convert_ok_py39(raw: str, value: Any, of_type: type[Any]) -> None:
7777
[
7878
("a", TypeVar, TypeError, r"a cannot cast to .*typing.TypeVar.*"),
7979
("3", Literal["1", "2"], ValueError, r"3 must be one of \('1', '2'\)"),
80-
("3", Union[str, int], TypeError, r"3 cannot cast to typing.Union\[str, int\]"),
80+
("3", Union[str, int], TypeError, r"3 cannot cast to (typing.Union\[str, int\]|str \| int)"),
8181
("", Command, ValueError, r"attempting to parse '' into a command failed"),
8282
],
8383
)

0 commit comments

Comments
 (0)