Skip to content

Commit

Permalink
Add stream options in test_openai
Browse files Browse the repository at this point in the history
  • Loading branch information
cthiriet committed Apr 25, 2024
1 parent 8c07337 commit 9962ec8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
model = models.data[0].id

model_ids = [m.id for m in models.data]
stream_options = [False, True]

schema = """{
"title": "Character",
Expand Down Expand Up @@ -78,7 +79,7 @@ def is_uuid4(string: str) -> bool:

@pytest.mark.parametrize(
"model,stream",
[(model, stream) for model in model_ids for stream in [False, True]],
[(model, stream) for model in model_ids for stream in stream_options],
)
def test_completion(model, stream):
print(f"=== Completion (model={model}, stream={stream}) ===")
Expand All @@ -99,7 +100,7 @@ def test_completion(model, stream):

@pytest.mark.parametrize(
"model,stream",
[(model, stream) for model in model_ids for stream in [False, True]],
[(model, stream) for model in model_ids for stream in stream_options],
)
def test_completion_json(model, stream):
print(f"=== Completion JSON (model={model}, stream={stream}) ===")
Expand All @@ -124,7 +125,7 @@ def test_completion_json(model, stream):

@pytest.mark.parametrize(
"model,stream",
[(model, stream) for model in model_ids for stream in [False, True]],
[(model, stream) for model in model_ids for stream in stream_options],
)
def test_completion_regex(model, stream):
print(f"=== Completion Regex (model={model}, stream={stream}) ===")
Expand All @@ -148,7 +149,7 @@ def test_completion_regex(model, stream):

@pytest.mark.parametrize(
"model,stream",
[(model, stream) for model in model_ids for stream in [False, True]],
[(model, stream) for model in model_ids for stream in stream_options],
)
def test_completion_guided_choice(model, stream):
print(f"=== Completion guided choice (model={model}, stream={stream}) ===")
Expand All @@ -173,7 +174,7 @@ def test_completion_guided_choice(model, stream):

@pytest.mark.parametrize(
"model,stream",
[(model, stream) for model in model_ids for stream in [False, True]],
[(model, stream) for model in model_ids for stream in stream_options],
)
def test_chat(model, stream):
print(f"=== Chat (model={model}, stream={stream}) ===")
Expand All @@ -199,7 +200,7 @@ def test_chat(model, stream):

@pytest.mark.parametrize(
"model,stream",
[(model, stream) for model in model_ids for stream in [False, True]],
[(model, stream) for model in model_ids for stream in stream_options],
)
def test_chat_json(model, stream):
print(f"=== Chat JSON (model={model}, stream={stream}) ===")
Expand Down Expand Up @@ -229,7 +230,7 @@ def test_chat_json(model, stream):

@pytest.mark.parametrize(
"model,stream",
[(model, stream) for model in model_ids for stream in [False, True]],
[(model, stream) for model in model_ids for stream in stream_options],
)
def test_chat_regex(model, stream):
print(f"=== Chat Regex (model={model}, stream={stream}) ===")
Expand All @@ -255,7 +256,7 @@ def test_chat_regex(model, stream):

@pytest.mark.parametrize(
"model,stream",
[(model, stream) for model in model_ids for stream in [False, True]],
[(model, stream) for model in model_ids for stream in stream_options],
)
def test_chat_guided_choice(model, stream):
print(f"=== Chat guided choice (model={model}, stream={stream}) ===")
Expand Down

0 comments on commit 9962ec8

Please sign in to comment.