Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update a test regex to work with Python 3.12+
Fixes #3065

New message:

    "argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'type'"
  • Loading branch information
hroncok committed Jul 17, 2023
commit bf13dbdb80573a10942a23e4b6071aaa5d3e64cf
1 change: 1 addition & 0 deletions docs/changelog/3065.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update a regular expression in tests to match the exception message in both Python 3.12 and older.
2 changes: 1 addition & 1 deletion tests/config/loader/test_memory_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_memory_loader(value: Any, of_type: type[Any], outcome: Any) -> None:
(["m"], List[int], ValueError, "invalid literal for int"),
({"m": 1}, Dict[int, int], ValueError, "invalid literal for int"),
({1: "m"}, Dict[int, int], ValueError, "invalid literal for int"),
(object, Path, TypeError, "expected str, bytes or os.PathLike object"),
(object, Path, TypeError, r"str(, bytes)? or (an )?os\.PathLike object"),
(1, Command, TypeError, "1"),
(1, EnvList, TypeError, "1"),
],
Expand Down