Skip to content

unused-test-factory-option

A private test factory exposes a literal option that visible callers never vary.

Why

Unused customization obscures the values that actually distinguish test scenarios.

Fix

Keep the value in the factory's construction instead of exposing an unused option; retain it if external callers need it.

Examples

Before — flagged Repeated calls never vary the option
tests/test_widget.py
def _make_widget(*, size=3):
return Widget(size=size)
_make_widget()
_make_widget(size=3)
After — preferred Keep customization that a caller exercises
tests/test_widget.py
def _make_widget(*, size=3):
return Widget(size=size)
def test_widget():
assert _make_widget(size=4)