From 840512205101590ed7490a6dbc7caf637bb7f76b 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:03:14 +0000 Subject: [PATCH] fix: correct test structure for Pydantic model validator exception handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix test_environment_variable_file_not_found to catch exception during I18N() instantiation - Exception is raised by Pydantic model validator during object creation, not explicit method call - Resolves Python 3.10 CI test failure Co-Authored-By: João --- tests/utilities/test_i18n.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/utilities/test_i18n.py b/tests/utilities/test_i18n.py index 78b0f28ca..5a3a3a3db 100644 --- a/tests/utilities/test_i18n.py +++ b/tests/utilities/test_i18n.py @@ -86,9 +86,8 @@ 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") - i18n = I18N() with pytest.raises(Exception, match="Prompt file '/nonexistent/file.json' not found"): - i18n.load_prompts() + I18N() def test_fallback_to_default_when_no_environment_variable(monkeypatch):