From 793075996253e58d097b727239dd686b11e9e7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B3pez=20Guimaraes?= <112760654+DaniElectra@users.noreply.github.com> Date: Fri, 8 Mar 2024 22:30:17 +0100 Subject: [PATCH] Update error check on test_load_script (#6726) #### Description This allows the "nonexistent" file error check to pass on systems that don't use English as their primary language. With this, all mitmproxy tests can pass on non-English machines. Fixes #6723 #### Checklist - [X] I have updated tests where applicable. - [ ] I have added an entry to the CHANGELOG. --- test/mitmproxy/addons/test_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mitmproxy/addons/test_script.py b/test/mitmproxy/addons/test_script.py index c36279cb4..e2dfc0b2b 100644 --- a/test/mitmproxy/addons/test_script.py +++ b/test/mitmproxy/addons/test_script.py @@ -25,7 +25,7 @@ def test_load_script(tmp_path, tdata, caplog): assert ns.addons script.load_script("nonexistent") - assert "No such file or directory" in caplog.text + assert "FileNotFoundError" in caplog.text (tmp_path / "error.py").write_text("this is invalid syntax") script.load_script(str(tmp_path / "error.py"))