OhMyBug

tests/ci

Test Sets Flag Code Never Reads

#66rare16 sightingsfirst seen August 2026

What goes wrong

A test sets a control — a flag, a stub, a property — on an object the code under test never reads, or the test setup itself repairs the very condition it is meant to check, so the assertion runs the default path while the test claims to cover the special one.

Example

The test patches the fetch function in one module, but the code imports it from another; the real fetch runs and the 'offline mode' test passes on the online path.

Not to be confused with

The control is disconnected, not a branch left unreached by the chosen inputs (Unreached Branch Test); not an expected value computed from the code under test.

Discovered by

Field notes · 4