-k should not match session name
Fixes https://github.com/pytest-dev/pytest/issues/7040.
This commit is contained in:
parent
d4dfe863c9
commit
3d3b9511fd
|
@ -0,0 +1 @@
|
|||
``-k`` no longer matches against the directory containing the test suite.
|
|
@ -136,7 +136,7 @@ class KeywordMatcher:
|
|||
import pytest
|
||||
|
||||
for item in item.listchain():
|
||||
if not isinstance(item, pytest.Instance):
|
||||
if not isinstance(item, (pytest.Instance, pytest.Session)):
|
||||
mapped_names.add(item.name)
|
||||
|
||||
# Add the names added as extra keywords to current or parent items
|
||||
|
|
Loading…
Reference in New Issue