|
Option C Tools
|
Functions | |
| str | _make_nontrivial (str content) |
| test_async_function_gets_func_pattern (Path temp_project_root, FormatterContext formatter_ctx_fix) | |
| test_async_function_with_pattern_unchanged (Path temp_project_root, FormatterContext formatter_ctx_fix) | |
| test_mixed_sync_and_async_both_fixed (Path temp_project_root, FormatterContext formatter_ctx_fix) | |
| test_async_method_in_class_gets_func_pattern (Path temp_project_root, FormatterContext formatter_ctx_fix) | |
Purpose
-------
OI-520 regression tests — verify ``fix_func_pattern`` also handles
``async def`` functions (previously only ``ast.FunctionDef`` was inspected,
so async functions were silently skipped).
Responsibilities
----------------
- Plain async function missing ``func = "..."`` gets one injected.
- Async function that already has the pattern is unchanged.
- Mixed sync + async file: both get fixed in the same pass.
- Async method inside a class is also covered.
Diagnostics
-----------
Domain: TESTS.FORMATTER
Levels:
L2 — test lifecycle
L3 — assertion details
L4 — deep tracing
Contracts
---------
- The formatter must treat ``async def`` bodies identically to ``def`` bodies.
|
protected |
| tests_formatter.test_format_async.test_async_function_gets_func_pattern | ( | Path | temp_project_root, |
| FormatterContext | formatter_ctx_fix ) |
| tests_formatter.test_format_async.test_async_function_with_pattern_unchanged | ( | Path | temp_project_root, |
| FormatterContext | formatter_ctx_fix ) |
| tests_formatter.test_format_async.test_async_method_in_class_gets_func_pattern | ( | Path | temp_project_root, |
| FormatterContext | formatter_ctx_fix ) |
| tests_formatter.test_format_async.test_mixed_sync_and_async_both_fixed | ( | Path | temp_project_root, |
| FormatterContext | formatter_ctx_fix ) |