Skip to content

Commit f489739

Browse files
committed
refactor(mark): use existing NOT_SET sentinel
1 parent 1cc35ec commit f489739

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/_pytest/mark/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from _pytest.config import ExitCode
2323
from _pytest.config import hookimpl
2424
from _pytest.config import UsageError
25+
from _pytest.config.argparsing import NOT_SET
2526
from _pytest.config.argparsing import Parser
2627
from _pytest.stash import StashKey
2728

@@ -214,9 +215,6 @@ def deselect_by_keyword(items: list[Item], config: Config) -> None:
214215
items[:] = remaining
215216

216217

217-
NOT_NONE_SENTINEL = object()
218-
219-
220218
@dataclasses.dataclass
221219
class MarkMatcher:
222220
"""A matcher for markers which are present.
@@ -243,9 +241,7 @@ def __call__(self, name: str, /, **kwargs: object) -> bool:
243241
return True
244242

245243
for mark in matches:
246-
if all(
247-
mark.kwargs.get(k, NOT_NONE_SENTINEL) == v for k, v in kwargs.items()
248-
):
244+
if all(mark.kwargs.get(k, NOT_SET) == v for k, v in kwargs.items()):
249245
return True
250246

251247
return False

0 commit comments

Comments
 (0)