Skip to content

test(function_schema): add tests for enforce_type_annotations behavior #1109

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

Closed
wants to merge 2 commits into from

Conversation

mshsheikh
Copy link
Contributor

Adds 4 new tests to validate enforce_type_annotations:

  • Enforcement: Checks if unannotated functions raise errors.
  • Fallback: Confirms unannotated parameters default to Any when disabled.
  • Compatibility: Ensures positional args (e.g., function_schema(my_func, "sphinx")) still work.

See Updated Code:
https://github.com/openai/openai-agents-python/blob/main/src/agents/function_schema.py

Adds 4 new tests to validate enforce_type_annotations:

- Enforcement: Checks if unannotated functions raise errors.
- Fallback: Confirms unannotated parameters default to Any when disabled.
- Compatibility: Ensures positional args (e.g., function_schema(my_func, "sphinx")) still work.

See Updated Code:
https://github.com/openai/openai-agents-python/blob/main/src/agents/function_schema.py
@seratch seratch added the duplicate This issue or pull request already exists label Jul 14, 2025
@seratch
Copy link
Member

seratch commented Jul 14, 2025

Could you add these tests to #1092 instead? Thank you!

@seratch seratch closed this Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants