-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Rule request
Description
I think a rule to test that all arguments but the first of pytest.approx() are keyword arguments would be useful
example (bad):
assert get_some_value() == pytest.approx(10, 5)
example (very bad):
assert get_some_value() == pytest.approx(1.1, 0, 4, True)
example (good):
assert get_some_value() == pytest.approx(10, abs=5)
assert get_some_value() == pytest.approx(10, rel=0.5)
Rationale
We had several issues because people thought that "abs" was the first parameter and when they omitted the keyword argument, the checked tolerance was suddenly much larger.
Plus I think it makes reading the code much easier.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request