2013-07-30 17:26:15 +08:00
|
|
|
|
|
|
|
.. _bash_completion:
|
|
|
|
|
|
|
|
Setting up bash completion
|
|
|
|
==========================
|
|
|
|
|
2014-01-18 19:31:33 +08:00
|
|
|
When using bash as your shell, ``pytest`` can use argcomplete
|
2016-05-19 00:12:39 +08:00
|
|
|
(https://argcomplete.readthedocs.io/) for auto-completion.
|
2013-07-30 17:26:15 +08:00
|
|
|
For this ``argcomplete`` needs to be installed **and** enabled.
|
|
|
|
|
|
|
|
Install argcomplete using::
|
|
|
|
|
|
|
|
sudo pip install 'argcomplete>=0.5.7'
|
|
|
|
|
|
|
|
For global activation of all argcomplete enabled python applications run::
|
|
|
|
|
|
|
|
sudo activate-global-python-argcomplete
|
|
|
|
|
2014-01-18 19:31:33 +08:00
|
|
|
For permanent (but not global) ``pytest`` activation, use::
|
2013-07-30 17:26:15 +08:00
|
|
|
|
|
|
|
register-python-argcomplete py.test >> ~/.bashrc
|
|
|
|
|
2014-01-18 19:31:33 +08:00
|
|
|
For one-time activation of argcomplete for ``pytest`` only, use::
|
2013-07-30 17:26:15 +08:00
|
|
|
|
|
|
|
eval "$(register-python-argcomplete py.test)"
|
|
|
|
|
|
|
|
|
|
|
|
|