Pytest权威教程27-Bash自动补全设置
Bash自动补全设置
在Linux/Mac bash shell环境下,可以使用argcomplete对pytest命令进行自动补全。首先要安装和启用argcomplete。
使用以下命令安装argcomplete:
sudo pip install 'argcomplete>=0.5.7'
全局激活argcomplete命令补全,对所有支持的Python包生效,可以执行:
sudo activate-global-python-argcomplete
仅对于pytest永久启用命令补全,可以执行:
register-python-argcomplete pytest >> ~/.bashrc
仅对pytest一次性启用命令补全,可以执行:
eval "$(register-python-argcomplete pytest)"

浙公网安备 33010602011771号