import pytest from xonsh.completers._aliases import complete_aliases @pytest.fixture def mock_completer(monkeypatch, xsh_with_aliases): def dummy_completer(*_): return xsh = xsh_with_aliases monkeypatch.setattr( xsh, "_completers", {"one": dummy_completer, "two": complete_aliases} ) monkeypatch.setattr(xsh, "ctx", {"three": lambda: 1, "four": lambda: 2}) return xsh @pytest.mark.parametrize( "args, positionals, options", [ ( "completer", {"add", "remove", "rm", "list", "ls", "complete"}, {"--help", "-h"}, ), ( "completer add", set(), {"--help", "-h"}, ), ( "completer add newcompleter", {"three", "four"}, {"--help", "-h"}, ), ( "completer add newcompleter three", {"two", ">one", "