Skip to content

Commit d3552ef

Browse files
authored
Clarify doc for running tests by nodeid section (#11249)
1 parent 448563c commit d3552ef

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

doc/en/how-to/usage.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,10 @@ Use ``""`` instead of ``''`` in expression when running this on Windows
4444

4545
.. _nodeids:
4646

47-
**Run tests by node ids**
47+
**Run tests by collection arguments**
4848

49-
Each collected test is assigned a unique ``nodeid`` which consist of the module file path followed
50-
by specifiers like class names and function names separated by ``::`` characters,
51-
and parameters from parametrization in ``[...]``.
52-
You can use the same syntax to match tests relative to the working directory.
49+
Pass the module filename relative to the working directory, followed by specifiers like the class name and function name
50+
separated by ``::`` characters, and parameters from parameterization enclosed in ``[]``.
5351

5452
To run a specific test within a module:
5553

@@ -69,6 +67,12 @@ Specifying a specific test method:
6967
7068
pytest tests/test_mod.py::TestClass::test_method
7169
70+
Specifying a specific parametrization of a test:
71+
72+
.. code-block:: bash
73+
74+
pytest tests/test_mod.py::test_func[x1,y2]
75+
7276
**Run tests by marker expressions**
7377

7478
.. code-block:: bash

0 commit comments

Comments
 (0)