Option C Tools
Loading...
Searching...
No Matches
tests_formatter.test_format_async Namespace Reference

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)

Detailed Description

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.

Function Documentation

◆ _make_nontrivial()

str tests_formatter.test_format_async._make_nontrivial ( str content)
protected

Definition at line 37 of file test_format_async.py.

Here is the caller graph for this function:

◆ test_async_function_gets_func_pattern()

tests_formatter.test_format_async.test_async_function_gets_func_pattern ( Path temp_project_root,
FormatterContext formatter_ctx_fix )

Definition at line 44 of file test_format_async.py.

Here is the call graph for this function:

◆ test_async_function_with_pattern_unchanged()

tests_formatter.test_format_async.test_async_function_with_pattern_unchanged ( Path temp_project_root,
FormatterContext formatter_ctx_fix )

Definition at line 64 of file test_format_async.py.

Here is the call graph for this function:

◆ test_async_method_in_class_gets_func_pattern()

tests_formatter.test_format_async.test_async_method_in_class_gets_func_pattern ( Path temp_project_root,
FormatterContext formatter_ctx_fix )

Definition at line 109 of file test_format_async.py.

Here is the call graph for this function:

◆ test_mixed_sync_and_async_both_fixed()

tests_formatter.test_format_async.test_mixed_sync_and_async_both_fixed ( Path temp_project_root,
FormatterContext formatter_ctx_fix )

Definition at line 84 of file test_format_async.py.

Here is the call graph for this function: