mark: move pytest_cmdline_main.tryfist into decorator

Avoids comments for ignored typing.
This commit is contained in:
Daniel Hahler 2019-10-27 05:56:13 +01:00
parent a92f49afa7
commit a4faac6c94
1 changed files with 2 additions and 4 deletions

View File

@ -8,6 +8,7 @@ from .structures import MARK_GEN
from .structures import MarkDecorator
from .structures import MarkGenerator
from .structures import ParameterSet
from _pytest.config import hookimpl
from _pytest.config import UsageError
__all__ = ["Mark", "MarkDecorator", "MarkGenerator", "get_empty_parameterset_mark"]
@ -74,6 +75,7 @@ def pytest_addoption(parser):
parser.addini(EMPTY_PARAMETERSET_OPTION, "default marker for empty parametersets")
@hookimpl(tryfirst=True)
def pytest_cmdline_main(config):
import _pytest.config
@ -91,10 +93,6 @@ def pytest_cmdline_main(config):
return 0
# Ignore type because of https://github.com/python/mypy/issues/2087.
pytest_cmdline_main.tryfirst = True # type: ignore
def deselect_by_keyword(items, config):
keywordexpr = config.option.keyword.lstrip()
if not keywordexpr: