From 7ff0760b49fd8912ea3eb11703e0df0a92a2ff6f Mon Sep 17 00:00:00 2001 From: Steffen Rehberg Date: Mon, 27 Nov 2023 13:31:09 +0100 Subject: [PATCH] TST: Make test_movie_writer_invalid_path locale-agnostic Filtering on the error message failed on locales different from English (just matching the error in brackets would also do). --- lib/matplotlib/tests/test_animation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/tests/test_animation.py b/lib/matplotlib/tests/test_animation.py index a4de96d77b62..d026dae59533 100644 --- a/lib/matplotlib/tests/test_animation.py +++ b/lib/matplotlib/tests/test_animation.py @@ -545,9 +545,9 @@ def test_disable_cache_warning(anim): def test_movie_writer_invalid_path(anim): if sys.platform == "win32": - match_str = re.escape("[WinError 3] The system cannot find the path specified:") + match_str = r"\[WinError 3] .*'\\\\foo\\\\bar\\\\aardvark'" else: - match_str = re.escape("[Errno 2] No such file or directory: '/foo") + match_str = r"\[Errno 2] .*'/foo" with pytest.raises(FileNotFoundError, match=match_str): anim.save("/foo/bar/aardvark/thiscannotreallyexist.mp4", writer=animation.FFMpegFileWriter())