Pytest权威教程27-Bash自动补全设置

返回: Pytest权威教程

Bash自动补全设置

在Linux/Mac bash shell环境下,可以使用argcompletepytest命令进行自动补全。首先要安装和启用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)"
原文地址:https://www.cnblogs.com/superhin/p/11677520.html