Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/pytest_mypy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def serialized(self) -> str:
return str(self.mypy_results_path)


item_marker = "mypy"
mypy_argv: List[str] = []
nodeid_name = "mypy"
stash_key = {
Expand Down Expand Up @@ -153,7 +154,7 @@ def pytest_configure(config: pytest.Config) -> None:

config.addinivalue_line(
"markers",
f"{MypyItem.MARKER}: mark tests to be checked by mypy.",
f"{item_marker}: mark tests to be checked by mypy.",
)
if config.getoption("--mypy-ignore-missing-imports"):
mypy_argv.append("--ignore-missing-imports")
Expand Down Expand Up @@ -206,11 +207,9 @@ def collect(self) -> Iterator[MypyItem]:
class MypyItem(pytest.Item):
"""A Mypy-related test Item."""

MARKER = "mypy"

def __init__(self, *args: Any, **kwargs: Any):
super().__init__(*args, **kwargs)
self.add_marker(self.MARKER)
self.add_marker(item_marker)

def repr_failure(
self,
Expand Down
Loading