-
Notifications
You must be signed in to change notification settings - Fork 1
Add live tests #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
openai/tests/test_client.py
Outdated
auth=OPENAI_API_KEY, | ||
backend="openai" | ||
) | ||
kwargs = {"client": client} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are silently dropping any kwargs
here. Is that intentional? If so, I'd explicitly pass in client
to the wrapped f
on the next line and not do a assign-new-value-to-kwargs
-and-spread-that-in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplified it. Didn't realize I could pass the values of parametrize to a fixture, but pytest lets you do it cleanly.
openai/tests/test_client.py
Outdated
@configure_client | ||
def test_client_completion(api_type, **kwargs): | ||
client = kwargs.pop("client") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not make client
a keyword-only argument to the test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was a workaround, but instead I just made client a fixture now 😆
Test real calls to the APIs through the client using azure and openai endpoints