Skip to content

Commit

Permalink
use openai fake fixture, update exception
Browse files Browse the repository at this point in the history
  • Loading branch information
leondz committed Sep 23, 2024
1 parent 60f9e12 commit ad501ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/generators/test_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import openai

import garak.exception
from garak.generators.openai import OpenAIGenerator


Expand Down Expand Up @@ -92,8 +93,9 @@ def test_openai_chat():
print("test passed!")


@pytest.mark.usefixtures("set_fake_env")
def test_reasoning_switch():
with pytest.raises(ValueError):
with pytest.raises(garak.exception.BadGeneratorException):
generator = OpenAIGenerator(
name="o1-mini"
) # o1 models should use ReasoningGenerator

0 comments on commit ad501ef

Please sign in to comment.