pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python-gitlab/python-gitlab/commit/e6669f96d662d310109afa4a61fe8dabbd780a4e

link crossorigen="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-c9ae636e7affabfe.css" /> docs(testing): document passing pytest options during local development · python-gitlab/python-gitlab@e6669f9 · GitHub
Skip to content

Commit e6669f9

Browse files
amimasJohnVillalovos
authored andcommitted
docs(testing): document passing pytest options during local development
Added a section into the contributing docs to show how to pass options to `pytest`. This can be useful during local development for selecting specific tests. Running entire test suite is very time consuming.
1 parent 3eda669 commit e6669f9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

CONTRIBUTING.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,32 @@ To cleanup the environment delete the container:
194194
docker rm -f gitlab-test
195195
docker rm -f gitlab-runner-test
196196
197+
Pass options to ``pytest``
198+
--------------------------
199+
200+
Options to ``pytest`` can be passed by adding them after ``--`` when running ``tox``:
201+
202+
.. code-block:: bash
203+
204+
tox -e api_func_v4 -- <pytest options>.
205+
206+
For example, you can use this to run a specific test. Running all tests can be time-consuming,
207+
so this allows you to focus on just the tests relevant to your changes. You can do this by passing
208+
the ``-k`` flag to ``pytest`` and setting a relevant expression to select the tests to run. For example:
209+
210+
.. code-block:: bash
211+
212+
# Run all API functional tests from the ``test_projects.py`` file:
213+
tox -e api_func_v4 -- --keep-containers -k test_projects.py
214+
215+
# Run only the ``test_get_project`` test method from the ``test_projects.py`` file:
216+
tox -e api_func_v4 -- --keep-containers -k "test_projects.py and test_create_project"
217+
218+
# The above will select all test methods start with ``test_create_project`` from the ``test_projects.py`` file.
219+
# To select only the ``test_create_project`` method, you can exclude other methods by using the ``not`` operator:
220+
tox -e api_func_v4 -- --keep-containers -k "test_projects.py and test_create_project and not test_create_project_"
221+
222+
197223
Rerunning failed CI workflows
198224
-----------------------------
199225

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy