| 1 |
|
| 2 |
.. _bash_completion: |
| 3 |
|
| 4 |
How to set up bash completion |
| 5 |
============================= |
| 6 |
|
| 7 |
When using bash as your shell, ``pytest`` can use argcomplete |
| 8 |
(https://kislyuk.github.io/argcomplete/) for auto-completion. |
| 9 |
For this ``argcomplete`` needs to be installed **and** enabled. |
| 10 |
|
| 11 |
Install argcomplete using: |
| 12 |
|
| 13 |
.. code-block:: bash |
| 14 |
|
| 15 |
sudo pip install 'argcomplete>=0.5.7' |
| 16 |
|
| 17 |
For global activation of all argcomplete enabled python applications run: |
| 18 |
|
| 19 |
.. code-block:: bash |
| 20 |
|
| 21 |
sudo activate-global-python-argcomplete |
| 22 |
|
| 23 |
For permanent (but not global) ``pytest`` activation, use: |
| 24 |
|
| 25 |
.. code-block:: bash |
| 26 |
|
| 27 |
register-python-argcomplete pytest >> ~/.bashrc |
| 28 |
|
| 29 |
For one-time activation of argcomplete for ``pytest`` only, use: |
| 30 |
|
| 31 |
.. code-block:: bash |
| 32 |
|
| 33 |
eval "$(register-python-argcomplete pytest)" |