repeated-argument
A call is given the same value for two parameters.
- Group
- Tests
- Runs
- On by default
- Level
- warning
- Reads
- Tests
- Fix
- None: which value to change is the author's choice
- Defends
- Fidelity: when the code is broken, the test fails.
Why
The test passes one value to two positional parameters of a call, so code that swaps them or reads one twice still passes. Values are compared as values, so 0x10 and 16 are the same. A repeated default such as 0 or "" is left to trivial-inputs.
The fix, as Ur suggests it: give each parameter a different value.
For agents
Give each parameter of a call under test a different value, so a test fails when the code swaps or confuses them.
Example
shop/orders.pydef line_total(quantity, unit_price):
return quantity * unit_price
tests/test_orders.pyfrom shop.orders import line_total
def test_line_total():
assert line_total(4, 4) == 16
$ ur lint --rule repeated-argument
warning[repeated-argument]: test `test_line_total` passes one value to two parameters, so swapping them goes unnoticed
--> ./tests/test_orders.py:5:12 test `test_line_total`
= step 1: ./tests/test_orders.py:5:23 a value
= step 2: ./tests/test_orders.py:5:26 the same value again
= hint: give each parameter a different value
= see: Choosing Values for Robust Tests, Google Testing Blog (2026-06-04), https://testing.googleblog.com/2026/06/choosing-values-for-robust-tests.html
0 clone classes and 1 test finding in 2 files
Source
Choosing Values for Robust Tests, Google Testing Blog (2026-06-04).