Skip to content

Commit fcefbb9

Browse files
fix: 🐛 store and use --mypy-config-file as string
1 parent b986572 commit fcefbb9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/pytest_mypy.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ def pytest_addoption(parser):
3232
action="store_true",
3333
help="suppresses error messages about imports that cannot be resolved",
3434
)
35-
35+
group.addoption(
36+
"--mypy-config-file",
37+
action="store",
38+
type=str,
39+
help="adds custom mypy config file",
40+
)
3641

3742
XDIST_WORKERINPUT_ATTRIBUTE_NAMES = (
3843
"workerinput",
@@ -95,7 +100,7 @@ def pytest_configure_node(self, node): # xdist hook
95100
mypy_argv.append("--ignore-missing-imports")
96101

97102
if config.getoption("--mypy-config-file"):
98-
mypy_argv.append("--config-file")
103+
mypy_argv.append("--config-file={}".format(config.getoption("--mypy-config-file")))
99104

100105
def pytest_collect_file(path, parent):
101106
"""Create a MypyFileItem for every file mypy should run on."""

0 commit comments

Comments
 (0)