Skip to content

Commit 6690b8a

Browse files
authored
Merge pull request #2807 from xuanluong/issue-1442-mention-not--k-help
[doc] Add example of -k 'not test' in help text
2 parents 966391c + 7093d8f commit 6690b8a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

_pytest/mark.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ def pytest_addoption(parser):
9191
"where all names are substring-matched against test names "
9292
"and their parent classes. Example: -k 'test_method or test_"
9393
"other' matches all test functions and classes whose name "
94-
"contains 'test_method' or 'test_other'. "
94+
"contains 'test_method' or 'test_other', while -k 'not test_method' "
95+
"matches those that don't contain 'test_method' in their names. "
9596
"Additionally keywords are matched to classes and functions "
9697
"containing extra names in their 'extra_keyword_matches' set, "
9798
"as well as functions which have names assigned directly to them."

changelog/1442.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
In help text of ``-k`` option, add example of using ``not`` to not select certain tests whose names match the provided expression.

0 commit comments

Comments
 (0)