-
Notifications
You must be signed in to change notification settings - Fork 0
Pytest Integration
The cornerstone feature of logic-cov is its comparative mode (-comp), which seamlessly bridges static code anatomy with dynamic test execution code coverage metrics.
To find gaps between what was executed by your test suite and where your business logic actually is, pass both the test directory and source directory alongside the -comp switch:
logic-cov tests/ scripts/ -compThe tool invokes pytest as a background process with automated coverage tracing (--cov and --cov-report=term-missing).
It captures raw unexecuted statement line markers generated by pytest-cov.
It performs an intersection calculation: discarding unexecuted lines belonging to purely GUI domains (e.g., UI layout parameters, cosmetic styles), isolating only unexecuted lines containing crucial Python logic.
krzysztof@lenovo:~/bing-glava-suite$ logic-cov tests/ scripts/ -comp
========================================================================================
======================== logic-cov: Logic Coverage Gap Analysis ========================
Name Logic Stmts Covered Missing Logic Cover%
----------------------------------------------------------------------------------------
scripts/glava-gui.py 476 357 119 75%
↳ Missing Logic: 892-1010
scripts/gui/__init__.py 0 0 0 100%
scripts/gui/color_button.py 122 122 0 100%
scripts/gui/colors.py 160 160 0 100%
scripts/gui/core.py 117 117 0 100%
scripts/gui/geometry.py 157 153 4 97%
↳ Missing Logic: 116-119
scripts/gui/glava.py 359 313 46 87%
↳ Missing Logic: 35-38, 60-63, 138-141, 223-226, 304-306, 354-356, 364-367, 387-389, 418-420, 431-444
scripts/gui/instance.py 108 108 0 100%
scripts/gui/instance_tab_bar.py 81 69 12 85%
↳ Missing Logic: 275-278, 367-370, 407-410
scripts/gui/modules/__init__.py 0 0 0 100%
scripts/gui/modules/bars.py 73 64 9 88%
↳ Missing Logic: 256-264
scripts/gui/modules/base.py 163 105 58 64%
↳ Missing Logic: 189-197, 226-243, 257-287
scripts/gui/modules/circle.py 67 54 13 81%
↳ Missing Logic: 97-100, 184-186, 328-333
scripts/gui/modules/glsl_io.py 233 233 0 100%
scripts/gui/modules/graph.py 40 40 0 100%
scripts/gui/modules/radial.py 62 58 4 94%
↳ Missing Logic: 117-120
scripts/gui/modules/wave.py 75 45 30 60%
↳ Missing Logic: 86-91, 211-220, 333-346
scripts/gui/tab_advanced.py 133 133 0 100%
scripts/gui/tab_main.py 362 362 0 100%
scripts/gui/tab_module.py 94 94 0 100%
scripts/gui/theme.py 6 3 3 50%
↳ Missing Logic: 188-190
scripts/gui/themes/__init__.py 0 0 0 100%
scripts/gui/widgets.py 70 55 15 79%
↳ Missing Logic: 27-41
----------------------------------------------------------------------------------------
TOTAL LOGIC 2958 2645 313 89%
========================================================================================
=============================== target analysis finished ===============================
Python code representations require accurate structural bounds during AST scans. logic-cov applies a smart line-offset padding rule. If a line containing missing logic is bound to a complex statement block (such as an execution fork or exception branch), the analyzer attempts to capture its operational context head (if, for, try).
This ensures that the output slices maintain logical context — providing developers with clean, contextual code references ready to be passed directly to LLMs for generating automated missing test configurations.