From 9f0f668d125738a85af964bbb033b28c7a801eb8 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 3 Aug 2025 09:05:11 +0000 Subject: [PATCH] fix: use simpler exception assertion for Python 3.10 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace pytest.raises match parameter with exc_info and string assertion - Avoids potential regex matching differences between Python versions - Should resolve Python 3.10 CI test failure while maintaining test effectiveness Co-Authored-By: João --- tests/utilities/test_i18n.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/utilities/test_i18n.py b/tests/utilities/test_i18n.py index 5a3a3a3db..e23da718e 100644 --- a/tests/utilities/test_i18n.py +++ b/tests/utilities/test_i18n.py @@ -86,8 +86,10 @@ def test_environment_variable_file_not_found(monkeypatch): """Test proper error handling when environment variable points to non-existent file""" monkeypatch.setenv("CREWAI_I18N_FILE", "/nonexistent/file.json") - with pytest.raises(Exception, match="Prompt file '/nonexistent/file.json' not found"): + with pytest.raises(Exception) as exc_info: I18N() + + assert "Prompt file '/nonexistent/file.json' not found" in str(exc_info.value) def test_fallback_to_default_when_no_environment_variable(monkeypatch):