Skip to content

test: add unit tests for _detect_docstring_style#3673

Closed
xiaweiwei67-stack wants to merge 1 commit into
openai:mainfrom
xiaweiwei67-stack:test/detect-docstring-style
Closed

test: add unit tests for _detect_docstring_style#3673
xiaweiwei67-stack wants to merge 1 commit into
openai:mainfrom
xiaweiwei67-stack:test/detect-docstring-style

Conversation

@xiaweiwei67-stack

Copy link
Copy Markdown

Summary

_detect_docstring_style in src/agents/function_schema.py approximates griffe's docstring-style auto-detection (used when building parameter descriptions for function tools), but it had no direct unit tests. This adds coverage for:

  • detection of each style (Sphinx field markers, NumPy dashed-underline headers, Google section headers),
  • the google fallback for docstrings with no recognizable markers and for an empty docstring,
  • the documented tie-break priority (sphinx > numpy > google) when scores are equal.

Tests only - no source or behavior changes.

Test plan

  • uv run pytest tests/test_function_schema.py -k detect_docstring_style -> 8 passed
  • ruff check and ruff format --check -> clean on the changed file
  • mypy -> clean on the changed file

Issue number

N/A

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

@seratch seratch added the wontfix This will not be worked on label Jun 22, 2026
@seratch

seratch commented Jun 22, 2026

Copy link
Copy Markdown
Member

Thanks for sharing this. However, we don't need this test addition.

@seratch seratch closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants