设置bash完成

当使用bash作为shell时, pytest 可以使用argcomplete(https://argcomplete.readthedocs.io/)自动完成。为此 argcomplete 需要安装 and 启用。

安装argComplete使用:

sudo pip install 'argcomplete>=0.5.7'

对于所有启用argComplete的python应用程序的全局激活,请运行:

sudo activate-global-python-argcomplete

永久(但非全球) pytest 激活,使用:

register-python-argcomplete pytest >> ~/.bashrc

用于一次性激活argComplete pytest 只,使用:

eval "$(register-python-argcomplete pytest)"