File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
packages/jupyter-ai/jupyter_ai/tests/completions Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,15 @@ class MockProvider(BaseProvider, FakeListLLM):
21
21
name = "My Provider"
22
22
model_id_key = "model"
23
23
models = ["model" ]
24
+ raise_exc : bool = False
24
25
25
26
def __init__ (self , ** kwargs ):
26
27
if "responses" not in kwargs :
27
28
kwargs ["responses" ] = ["Test response" ]
28
29
super ().__init__ (** kwargs )
29
30
30
31
async def _acall (self , * args , ** kwargs ):
31
- if hasattr ( self , "raise_exc" ) and self .raise_exc :
32
+ if self .raise_exc :
32
33
raise Exception ("Test exception" )
33
34
else :
34
35
return super ()._call (* args , ** kwargs )
@@ -209,5 +210,5 @@ async def test_handle_request_with_error(inline_handler):
209
210
)
210
211
await inline_handler .on_message (json .dumps (dict (dummy_request )))
211
212
await inline_handler .tasks [0 ]
212
- error = inline_handler .messages [- 1 ].dict ().get ("error" , None )
213
+ error = inline_handler .messages [- 1 ].model_dump ().get ("error" , None )
213
214
assert error is not None
You can’t perform that action at this time.
0 commit comments