Option C Tools
Loading...
Searching...
No Matches
tests_health.conftest Namespace Reference

Functions

Path temp_project_root (Path tmp_path)
LinterContext linter_ctx (Path temp_project_root)
str make_compliant_file (str filename)
str make_func_pattern_violation_file (str filename)

Variables

str NON_COMPLIANT_FILE

Detailed Description

Shared fixtures for health dashboard tests.

Purpose
-------
Provide reusable test fixtures for health check unit and integration tests.

Responsibilities
----------------
- Create temporary Option C projects with required directory structure.
- Provide LinterContext for health check functions.
- Create compliant and non-compliant test files.

Diagnostics
-----------
Domain: TESTS.HEALTH
Levels:
    L2 — test lifecycle and setup
    L3 — fixture creation and teardown
    L4 — file operations and structure verification

Contracts
---------
- temp_project_root fixture provides a clean, isolated test project.
- LinterContext is properly configured for the temporary project.

Function Documentation

◆ linter_ctx()

LinterContext tests_health.conftest.linter_ctx ( Path temp_project_root)
Return a LinterContext configured for the temporary test project.

Definition at line 58 of file conftest.py.

◆ make_compliant_file()

str tests_health.conftest.make_compliant_file ( str filename)
Generate a fully compliant Option C file with the given filename.

Definition at line 71 of file conftest.py.

◆ make_func_pattern_violation_file()

str tests_health.conftest.make_func_pattern_violation_file ( str filename)
Generate a file that is compliant except for a missing func pattern.

The file has a function that calls ``_dbg()`` without first assigning
``func = "..."``.  The file is long enough (>= 20 lines) to avoid
the trivial-file exemption.

Definition at line 123 of file conftest.py.

◆ temp_project_root()

Path tests_health.conftest.temp_project_root ( Path tmp_path)
Create a temporary Option C project root with required directory structure.

Returns the project root path. All required directories are created.

Definition at line 39 of file conftest.py.

Variable Documentation

◆ NON_COMPLIANT_FILE

str tests_health.conftest.NON_COMPLIANT_FILE
Initial value:
1= '''\
2# Missing header
3def broken():
4 return 1
5'''

Definition at line 116 of file conftest.py.