-k should not match session name

Fixes https://github.com/pytest-dev/pytest/issues/7040.
This commit is contained in:
Daniel Hahler 2020-04-08 18:52:48 +02:00 committed by Bruno Oliveira
parent d4dfe863c9
commit 3d3b9511fd
2 changed files with 2 additions and 1 deletions

View File

@ -0,0 +1 @@
``-k`` no longer matches against the directory containing the test suite.

View File

@ -136,7 +136,7 @@ class KeywordMatcher:
import pytest import pytest
for item in item.listchain(): for item in item.listchain():
if not isinstance(item, pytest.Instance): if not isinstance(item, (pytest.Instance, pytest.Session)):
mapped_names.add(item.name) mapped_names.add(item.name)
# Add the names added as extra keywords to current or parent items # Add the names added as extra keywords to current or parent items