Skip to content

test: add missing prompt validation for sync and async resource methods#3078

Open
dhruvgupta2109 wants to merge 2 commits intoopenai:mainfrom
dhruvgupta2109:pr/required-args-resource-regressions
Open

test: add missing prompt validation for sync and async resource methods#3078
dhruvgupta2109 wants to merge 2 commits intoopenai:mainfrom
dhruvgupta2109:pr/required-args-resource-regressions

Conversation

@dhruvgupta2109
Copy link
Copy Markdown

This pull request adds new tests to ensure that required arguments are properly enforced in the OpenAI Python client, both for synchronous and asynchronous resource methods. The tests verify that appropriate exceptions are raised when mandatory parameters are missing.

Testing improvements:

  • Added tests for synchronous methods in the OpenAI client to check that a TypeError is raised when required arguments (such as prompt, image, or model) are missing in completions.create, images.edit, and audio.transcriptions.create methods.
  • Added asynchronous tests for the AsyncOpenAI client to verify that missing required arguments in chat.completions.create and images.generate correctly raise a TypeError.

Dependency updates:

  • Imported OpenAI and AsyncOpenAI classes in tests/test_required_args.py to support the new tests.

@dhruvgupta2109 dhruvgupta2109 requested a review from a team as a code owner April 12, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant