Skip to content

Commit 869040b

Browse files
authored
Update a test regex to work with Python 3.12+ (#3066)
Fixes #3065 New message: "argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'type'"
1 parent 2124b95 commit 869040b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/changelog/3065.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update a regular expression in tests to match the exception message in both Python 3.12 and older.

tests/config/loader/test_memory_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_memory_loader(value: Any, of_type: type[Any], outcome: Any) -> None:
6666
(["m"], List[int], ValueError, "invalid literal for int"),
6767
({"m": 1}, Dict[int, int], ValueError, "invalid literal for int"),
6868
({1: "m"}, Dict[int, int], ValueError, "invalid literal for int"),
69-
(object, Path, TypeError, "expected str, bytes or os.PathLike object"),
69+
(object, Path, TypeError, r"str(, bytes)? or (an )?os\.PathLike object"),
7070
(1, Command, TypeError, "1"),
7171
(1, EnvList, TypeError, "1"),
7272
],

0 commit comments

Comments
 (0)