File tree Expand file tree Collapse file tree 1 file changed +1
-15
lines changed
Expand file tree Collapse file tree 1 file changed +1
-15
lines changed Original file line number Diff line number Diff 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 ()
184170class TestResourceList :
185171 def test_create_with_list (self ):
186172 """ResourceList should be created with a list of items."""
You can’t perform that action at this time.
0 commit comments