Clarify doc for running tests by nodeid section (#11249)
This commit is contained in:
parent
448563caaa
commit
d3552ef4c0
|
@ -44,12 +44,10 @@ Use ``""`` instead of ``''`` in expression when running this on Windows
|
|||
|
||||
.. _nodeids:
|
||||
|
||||
**Run tests by node ids**
|
||||
**Run tests by collection arguments**
|
||||
|
||||
Each collected test is assigned a unique ``nodeid`` which consist of the module file path followed
|
||||
by specifiers like class names and function names separated by ``::`` characters,
|
||||
and parameters from parametrization in ``[...]``.
|
||||
You can use the same syntax to match tests relative to the working directory.
|
||||
Pass the module filename relative to the working directory, followed by specifiers like the class name and function name
|
||||
separated by ``::`` characters, and parameters from parameterization enclosed in ``[]``.
|
||||
|
||||
To run a specific test within a module:
|
||||
|
||||
|
@ -69,6 +67,12 @@ Specifying a specific test method:
|
|||
|
||||
pytest tests/test_mod.py::TestClass::test_method
|
||||
|
||||
Specifying a specific parametrization of a test:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
pytest tests/test_mod.py::test_func[x1,y2]
|
||||
|
||||
**Run tests by marker expressions**
|
||||
|
||||
.. code-block:: bash
|
||||
|
|
Loading…
Reference in New Issue