Files
dvc/tests/unit/command/test_completion.py
T
skshetry bc86fa0643 completion: fix broken completion generation for zsh (#9797)
`dvc commit --help` was also completely broken, which is also fixed.

This adds unit tests for completion generation for both zsh/bash, and
tests that --help works for all commands.
2023-08-04 09:21:01 +05:45

18 lines
398 B
Python

import logging
import pytest
from dvc.cli import main
from dvc.commands.completion import SUPPORTED_SHELLS
@pytest.mark.parametrize("shell", SUPPORTED_SHELLS)
def test_completion(caplog, capsys, shell):
with caplog.at_level(logging.INFO):
assert main(["completion", "-s", shell]) == 0
assert not caplog.text
out, err = capsys.readouterr()
assert not err
assert out