From 7093d8f65e48a0c944d1688f9d80d7e8f51b6b8b Mon Sep 17 00:00:00 2001 From: Xuan Luong Date: Sat, 30 Sep 2017 18:36:09 -0400 Subject: [PATCH] Add example of -k 'not test' in help text --- _pytest/mark.py | 3 ++- changelog/1442.doc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog/1442.doc diff --git a/_pytest/mark.py b/_pytest/mark.py index d9af0ffaa8d..e4b6238eb9e 100644 --- a/_pytest/mark.py +++ b/_pytest/mark.py @@ -91,7 +91,8 @@ def pytest_addoption(parser): "where all names are substring-matched against test names " "and their parent classes. Example: -k 'test_method or test_" "other' matches all test functions and classes whose name " - "contains 'test_method' or 'test_other'. " + "contains 'test_method' or 'test_other', while -k 'not test_method' " + "matches those that don't contain 'test_method' in their names. " "Additionally keywords are matched to classes and functions " "containing extra names in their 'extra_keyword_matches' set, " "as well as functions which have names assigned directly to them." diff --git a/changelog/1442.doc b/changelog/1442.doc new file mode 100644 index 00000000000..62ccf750471 --- /dev/null +++ b/changelog/1442.doc @@ -0,0 +1 @@ +In help text of ``-k`` option, add example of using ``not`` to not select certain tests whose names match the provided expression. \ No newline at end of file