Update usage.rst

This commit is contained in:
Ran Benita 2023-07-28 09:45:37 +03:00 committed by GitHub
parent eb41032729
commit a69c957468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -46,8 +46,8 @@ Use ``""`` instead of ``''`` in expression when running this on Windows
**Run tests by collection argument** **Run tests by collection argument**
Pass the module filename relative to working directory followed by specifiers like class names, function names and Pass the module filename relative to the working directory, followed by specifiers like the class name and function name
parameters from parameterization, separated by ``::`` characters. separated by ``::`` characters, and parameters from parameterization enclosed in ``[]``.
To run a specific test within a module: To run a specific test within a module:
@ -67,6 +67,12 @@ Specifying a specific test method:
pytest tests/test_mod.py::TestClass::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** **Run tests by marker expressions**
.. code-block:: bash .. code-block:: bash