deselect_by_keyword: skip without expression
There is no need to iterate over all items always, if `-k` is not specified.
This commit is contained in:
parent
19035f4b55
commit
6a73714b00
|
@ -100,6 +100,9 @@ pytest_cmdline_main.tryfirst = True
|
||||||
|
|
||||||
def deselect_by_keyword(items, config):
|
def deselect_by_keyword(items, config):
|
||||||
keywordexpr = config.option.keyword.lstrip()
|
keywordexpr = config.option.keyword.lstrip()
|
||||||
|
if not keywordexpr:
|
||||||
|
return
|
||||||
|
|
||||||
if keywordexpr.startswith("-"):
|
if keywordexpr.startswith("-"):
|
||||||
keywordexpr = "not " + keywordexpr[1:]
|
keywordexpr = "not " + keywordexpr[1:]
|
||||||
selectuntil = False
|
selectuntil = False
|
||||||
|
|
Loading…
Reference in New Issue