Skip to content

Commit 8ad390a

Browse files
authored
Merge pull request #183 from dmtucker/marker
Replace MypyItem.MARKER with item_marker
2 parents 139ca47 + 506d914 commit 8ad390a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/pytest_mypy/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def serialized(self) -> str:
4848
return str(self.mypy_results_path)
4949

5050

51+
item_marker = "mypy"
5152
mypy_argv: List[str] = []
5253
nodeid_name = "mypy"
5354
stash_key = {
@@ -153,7 +154,7 @@ def pytest_configure(config: pytest.Config) -> None:
153154

154155
config.addinivalue_line(
155156
"markers",
156-
f"{MypyItem.MARKER}: mark tests to be checked by mypy.",
157+
f"{item_marker}: mark tests to be checked by mypy.",
157158
)
158159
if config.getoption("--mypy-ignore-missing-imports"):
159160
mypy_argv.append("--ignore-missing-imports")
@@ -206,11 +207,9 @@ def collect(self) -> Iterator[MypyItem]:
206207
class MypyItem(pytest.Item):
207208
"""A Mypy-related test Item."""
208209

209-
MARKER = "mypy"
210-
211210
def __init__(self, *args: Any, **kwargs: Any):
212211
super().__init__(*args, **kwargs)
213-
self.add_marker(self.MARKER)
212+
self.add_marker(item_marker)
214213

215214
def repr_failure(
216215
self,

0 commit comments

Comments
 (0)