|
Option C Tools
|
Functions | |
| test_add_missing_docstring (Path temp_project_root, FormatterContext formatter_ctx_fix) | |
| test_add_missing_section_purpose (Path temp_project_root, FormatterContext formatter_ctx_fix) | |
| test_preserve_existing_docstring (Path temp_project_root, FormatterContext formatter_ctx_fix) | |
| test_docstring_dry_run (Path temp_project_root, FormatterContext formatter_ctx) | |
| test_complete_docstring_no_change (Path temp_project_root, FormatterContext formatter_ctx_fix) | |
Tests for docstring fixing.
Purpose
-------
Verify that the formatter correctly fixes missing/incomplete module docstrings.
Responsibilities
----------------
- Test addition of complete docstring when missing.
- Test addition of missing sections to partial docstrings.
- Test preservation of existing docstring content.
- Test correct positioning after header block.
Diagnostics
-----------
Domain: TESTS.FORMATTER
Levels:
L2 — test lifecycle
L3 — test case setup
L4 — detailed docstring parsing and verification
Contracts
---------
- New docstrings are inserted after the header block (after blank line).
- Existing docstrings are never replaced, only extended.
- All required sections are present in the result.
| tests_formatter.test_docstring_fixing.test_add_missing_docstring | ( | Path | temp_project_root, |
| FormatterContext | formatter_ctx_fix ) |
Test that complete docstring skeleton is added when missing.
Definition at line 40 of file test_docstring_fixing.py.
| tests_formatter.test_docstring_fixing.test_add_missing_section_purpose | ( | Path | temp_project_root, |
| FormatterContext | formatter_ctx_fix ) |
Test that missing Purpose section is added.
Definition at line 63 of file test_docstring_fixing.py.
| tests_formatter.test_docstring_fixing.test_complete_docstring_no_change | ( | Path | temp_project_root, |
| FormatterContext | formatter_ctx_fix ) |
Test that complete docstrings are not modified.
Definition at line 107 of file test_docstring_fixing.py.
| tests_formatter.test_docstring_fixing.test_docstring_dry_run | ( | Path | temp_project_root, |
| FormatterContext | formatter_ctx ) |
Test that dry-run mode doesn't modify files.
Definition at line 95 of file test_docstring_fixing.py.
| tests_formatter.test_docstring_fixing.test_preserve_existing_docstring | ( | Path | temp_project_root, |
| FormatterContext | formatter_ctx_fix ) |
Test that existing docstring content is preserved.
Definition at line 77 of file test_docstring_fixing.py.