From fea59cfc52885e500e6b4e743b07f6a50948e764 Mon Sep 17 00:00:00 2001 From: skshetry <18718008+skshetry@users.noreply.github.com> Date: Sat, 19 Aug 2023 10:02:31 +0545 Subject: [PATCH] tests: simplify test parametrization (#9858) i.e. remove metafunc/pytest_generate_tests --- tests/unit/command/test_help.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/unit/command/test_help.py b/tests/unit/command/test_help.py index f03cbb246..dfe84d966 100644 --- a/tests/unit/command/test_help.py +++ b/tests/unit/command/test_help.py @@ -28,15 +28,11 @@ def command_tuples(): return sorted(commands) -def pytest_generate_tests(metafunc): - def ids(values): - if values: - return "-".join(values) - return "dvc" - - metafunc.parametrize("command_tuples", command_tuples(), ids=ids) +def ids(values): + return "-".join(values) or "dvc" +@pytest.mark.parametrize("command_tuples", command_tuples(), ids=ids) def test_help(caplog, capsys, command_tuples): with caplog.at_level(logging.INFO), pytest.raises(SystemExit) as e: main([*command_tuples, "--help"])