Skip to content

Commit

Permalink
-k should not match session name
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed authored and nicoddemus committed May 16, 2020
1 parent d4dfe86 commit 3d3b951
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/7040.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``-k`` no longer matches against the directory containing the test suite.
2 changes: 1 addition & 1 deletion src/_pytest/mark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def from_item(cls, item: "Item") -> "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
Expand Down

0 comments on commit 3d3b951

Please sign in to comment.