From 869040b2f4422ead24d436557f669a69712bbd97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 17 Jul 2023 15:24:10 +0200 Subject: [PATCH] Update a test regex to work with Python 3.12+ (#3066) Fixes https://github.com/tox-dev/tox/issues/3065 New message: "argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'type'" --- docs/changelog/3065.bugfix.rst | 1 + tests/config/loader/test_memory_loader.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 docs/changelog/3065.bugfix.rst diff --git a/docs/changelog/3065.bugfix.rst b/docs/changelog/3065.bugfix.rst new file mode 100644 index 000000000..774b33b24 --- /dev/null +++ b/docs/changelog/3065.bugfix.rst @@ -0,0 +1 @@ +Update a regular expression in tests to match the exception message in both Python 3.12 and older. diff --git a/tests/config/loader/test_memory_loader.py b/tests/config/loader/test_memory_loader.py index 6f645540e..8ab7f8f62 100644 --- a/tests/config/loader/test_memory_loader.py +++ b/tests/config/loader/test_memory_loader.py @@ -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"), ],