Update docs about case-insensitive expression matching

This commit is contained in:
Christoph Buelter 2019-12-05 14:13:22 +01:00
parent e24b6b0388
commit ac5929eef3
3 changed files with 8 additions and 3 deletions

View File

@ -148,6 +148,10 @@ which implements a substring match on the test names instead of the
exact match on markers that ``-m`` provides. This makes it easy to exact match on markers that ``-m`` provides. This makes it easy to
select tests based on their names: select tests based on their names:
.. versionadded: 5.3.1/6.0
The expression matching is now case-insensitive.
.. code-block:: pytest .. code-block:: pytest
$ pytest -v -k http # running with the above defined example module $ pytest -v -k http # running with the above defined example module

View File

@ -94,8 +94,8 @@ Pytest supports several ways to run and select tests from the command-line.
pytest -k "MyClass and not method" pytest -k "MyClass and not method"
This will run tests which contain names that match the given *string expression*, which can This will run tests which contain names that match the given *string expression* (case-insensitive),
include Python operators that use filenames, class names and function names as variables. which can include Python operators that use filenames, class names and function names as variables.
The example above will run ``TestMyClass.test_something`` but not ``TestMyClass.test_method_simple``. The example above will run ``TestMyClass.test_something`` but not ``TestMyClass.test_method_simple``.
.. _nodeids: .. _nodeids:

View File

@ -52,7 +52,8 @@ def pytest_addoption(parser):
"-k 'not test_method and not test_other' will eliminate the matches. " "-k 'not test_method and not test_other' will eliminate the matches. "
"Additionally keywords are matched to classes and functions " "Additionally keywords are matched to classes and functions "
"containing extra names in their 'extra_keyword_matches' set, " "containing extra names in their 'extra_keyword_matches' set, "
"as well as functions which have names assigned directly to them.", "as well as functions which have names assigned directly to them. "
"The matching is case-insensitive.",
) )
group._addoption( group._addoption(