File tree 2 files changed +6
-10
lines changed
2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ def predict():
175
175
176
176
177
177
def test_encode_response_with_custom_spec_api ():
178
- class CustomSpecAPI (ls .test_examples . TestAPI ):
178
+ class CustomSpecAPI (ls .OpenAISpec ):
179
179
def encode_response (self , output_stream ):
180
180
for output in output_stream :
181
181
yield {"content" : output }
Original file line number Diff line number Diff line change @@ -176,15 +176,11 @@ def encode_response(self, output):
176
176
177
177
@pytest .mark .asyncio
178
178
async def test_openai_spec_validation (openai_request_data ):
179
- server = ls .LitServer (IncorrectAPI1 (), spec = OpenAISpec ())
180
- with pytest .raises (ValueError , match = "predict is not a generator" ), wrap_litserve_start (server ) as server :
181
- async with LifespanManager (server .app ) as manager :
182
- await manager .shutdown ()
183
-
184
- server = ls .LitServer (IncorrectAPI2 (), spec = OpenAISpec ())
185
- with pytest .raises (ValueError , match = "encode_response is not a generator" ), wrap_litserve_start (server ) as server :
186
- async with LifespanManager (server .app ) as manager :
187
- await manager .shutdown ()
179
+ with pytest .raises (ValueError , match = "predict is not a generator" ):
180
+ ls .LitServer (IncorrectAPI1 (), spec = OpenAISpec ())
181
+
182
+ with pytest .raises (ValueError , match = "encode_response is not a generator" ):
183
+ ls .LitServer (IncorrectAPI2 (), spec = OpenAISpec ())
188
184
189
185
190
186
class PrePopulatedAPI (ls .LitAPI ):
You can’t perform that action at this time.
0 commit comments