Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace MypyItem.MARKER with item_marker #183

Merged
merged 1 commit into from
Oct 7, 2024
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