Skip to content

Commit e23dd98

Browse files
Datata1Copilot
andauthored
Update tests/core/test_base.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 1326f90 commit e23dd98

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

tests/core/test_base.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,22 +165,8 @@ class SampleModel(CamelModel):
165165
model = SampleModel(team_id=1)
166166

167167
with patch.dict(sys.modules, {"yaml": None}):
168-
# Force reimport to trigger ImportError
169168
with pytest.raises(ImportError, match="PyYAML is required"):
170-
# We need to actually make the import fail
171-
import builtins
172-
173-
original_import = builtins.__import__
174-
175-
def mock_import(name, *args, **kwargs):
176-
if name == "yaml":
177-
raise ImportError("No module named 'yaml'")
178-
return original_import(name, *args, **kwargs)
179-
180-
with patch.object(builtins, "__import__", mock_import):
181-
model.to_yaml()
182-
183-
169+
model.to_yaml()
184170
class TestResourceList:
185171
def test_create_with_list(self):
186172
"""ResourceList should be created with a list of items."""

0 commit comments

Comments
 (0)