Skip to content

Commit

Permalink
Merge pull request #183 from dmtucker/marker
Browse files Browse the repository at this point in the history
Replace MypyItem.MARKER with item_marker
  • Loading branch information
dmtucker authored Oct 7, 2024
2 parents 139ca47 + 506d914 commit 8ad390a
Showing 1 changed file with 3 additions and 4 deletions.
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

0 comments on commit 8ad390a

Please sign in to comment.