Add IDs to parameterised test cases
@@ -132,18 +132,18 @@ def f():
@pytest.mark.parametrize(
"code, expected_complexity",
[
- pytest.param("def f(): pass", 1),
- pytest.param(_expr_as_statement, 1),
- pytest.param(_sequential, 1),
- pytest.param(_sequential_unencapsulated, 0),
- pytest.param(_if_elif_else_dead_path, 3),
- pytest.param(_for_loop, 2),
- pytest.param(_for_else, 2),
- pytest.param(_recursive, 2),
- pytest.param(_nested_functions, 3),
- pytest.param(_try_else, 4),
- pytest.param(_async_keywords, 3),
- pytest.param(_annotated_assign, 1),
+ pytest.param("def f(): pass", 1, id="trivial"),
+ pytest.param(_expr_as_statement, 1, id="expression-as-statement"),
+ pytest.param(_sequential, 1, id="sequential"),
+ pytest.param(_sequential_unencapsulated, 0, id="sequential-unencapsulated"),
+ pytest.param(_if_elif_else_dead_path, 3, id="if-elif-else-dead-path"),
+ pytest.param(_for_loop, 2, id="for-loop"),
+ pytest.param(_for_else, 2, id="for-else"),
+ pytest.param(_recursive, 2, id="recursive"),
+ pytest.param(_nested_functions, 3, id="nested-functions"),
+ pytest.param(_try_else, 4, id="try-else"),
+ pytest.param(_async_keywords, 3, id="async-keywords"),
+ pytest.param(_annotated_assign, 1, id="annotated-assign"),
],
)
def test_mccabe_complexity(code: str, expected_complexity: int):
