mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
tests: simplify test parametrization (#9858)
i.e. remove metafunc/pytest_generate_tests
This commit is contained in:
@@ -28,15 +28,11 @@ def command_tuples():
|
|||||||
return sorted(commands)
|
return sorted(commands)
|
||||||
|
|
||||||
|
|
||||||
def pytest_generate_tests(metafunc):
|
def ids(values):
|
||||||
def ids(values):
|
return "-".join(values) or "dvc"
|
||||||
if values:
|
|
||||||
return "-".join(values)
|
|
||||||
return "dvc"
|
|
||||||
|
|
||||||
metafunc.parametrize("command_tuples", command_tuples(), ids=ids)
|
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("command_tuples", command_tuples(), ids=ids)
|
||||||
def test_help(caplog, capsys, command_tuples):
|
def test_help(caplog, capsys, command_tuples):
|
||||||
with caplog.at_level(logging.INFO), pytest.raises(SystemExit) as e:
|
with caplog.at_level(logging.INFO), pytest.raises(SystemExit) as e:
|
||||||
main([*command_tuples, "--help"])
|
main([*command_tuples, "--help"])
|
||||||
|
|||||||
Reference in New Issue
Block a user