Skip to content

Commit cbc39dd

Browse files
authored
Merge pull request #6079 from blueyed/tryfirst
mark: move pytest_cmdline_main.tryfist into decorator
2 parents a92f49a + a4faac6 commit cbc39dd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/_pytest/mark/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from .structures import MarkDecorator
99
from .structures import MarkGenerator
1010
from .structures import ParameterSet
11+
from _pytest.config import hookimpl
1112
from _pytest.config import UsageError
1213

1314
__all__ = ["Mark", "MarkDecorator", "MarkGenerator", "get_empty_parameterset_mark"]
@@ -74,6 +75,7 @@ def pytest_addoption(parser):
7475
parser.addini(EMPTY_PARAMETERSET_OPTION, "default marker for empty parametersets")
7576

7677

78+
@hookimpl(tryfirst=True)
7779
def pytest_cmdline_main(config):
7880
import _pytest.config
7981

@@ -91,10 +93,6 @@ def pytest_cmdline_main(config):
9193
return 0
9294

9395

94-
# Ignore type because of https://github.com/python/mypy/issues/2087.
95-
pytest_cmdline_main.tryfirst = True # type: ignore
96-
97-
9896
def deselect_by_keyword(items, config):
9997
keywordexpr = config.option.keyword.lstrip()
10098
if not keywordexpr:

0 commit comments

Comments
 (0)