no-provably-dead-mock-configuration
Remove mock behavior configuration proven unable to affect a test.
Why
A mock behavior value is dead when a same-path write replaces it before observation, or when a terminal exact-path assertion proves the configured mock was never called.
Fix
Delete the earlier overwritten configuration, or place the intended action before reconfiguration; delete behavior configuration contradicted by a terminal never-called assertion.
Examples
from unittest.mock import Mock
def test_charge(): charge = Mock() charge.return_value = 1 charge.return_value = 2 assert charge() == 2from unittest.mock import Mock
def test_charge(): charge = Mock() charge.return_value = 1 assert charge() == 1 charge.return_value = 2 assert charge() == 2Formerly: unused-mock-setup