Skip to content

Commit

Permalink
Update a test regex to work with Python 3.12+ (#3066)
Browse files Browse the repository at this point in the history
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 authored Jul 17, 2023
1 parent 2124b95 commit 869040b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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

0 comments on commit 869040b

Please sign in to comment.