VS Code Support for pytest-mypy
@eleanorjboyd is already working on this.
Since Jun 7, 2025.
Assessment
This issue has not been assessed yet.
Description
Hello!
I am the maintainer of testing for vscode-python and have been investigating: https://github.com/microsoft/vscode-python/issues/23933. I have some questions in regards to how I can support pytest-mypy. This discussion is similar to the one I started on the pytest-ruff repo here: https://github.com/businho/pytest-ruff/discussions/32.
I explained a bit in the attached issue but what I think the best fix is would be including an extra "mypy" test node nested under each file node on the test explorer. (one side question I have is if there should be two nodes? The mypyFileItem and the mypyStatusItem?) We run tests based on their test-ids, so this would mean the mypy test would have a test-id that would be passed. Also it would fix the issue where no tests show up, this is just a side effect of the mypy node impacting the discovery process. Looking for a bit of advice as there is a piece of implementation.
What happens is while building the test tree to then display is I cycle through all the session.items see code. I am not seeing the mypy node- is this added after or should I expect it during run? I see if I run python -m pytest --mypy --collect-only from the terminal I do get 3 items:
<Dir 23933-pytest-mypy>
<MypyFile test_ran.py>
<MypyFileItem mypy>
<MypyStatusItem mypy-status>
<Module test_ran.py>
<Function test_mypy>
so during collect it does exist but im not sure how I can see / access it from my plugin.
I appreciate any advice on how to support this. I have a few more questions but wanted to get the ball rolling with this initial one. Thanks
- Dominant language
- Python
- Stars
- 257
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from realpython/pytest-mypy
-
integration
Difficulty 3/5 1-2 days Newbie friendliness 38/100
realpython/pytest-mypy#196 · 2 comments ·
-
integration
Difficulty 3/5 1-2 days Newbie friendliness 38/100
realpython/pytest-mypy#160 · 4 comments ·
-
integration
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
realpython/pytest-mypy#138 · 2 comments · 2 reactions ·
-
Expected mypy errors Open
realpython/pytest-mypy#105 · 4 comments · 1 assignee ·
-
reporting
Difficulty 5/5 Over a week Newbie friendliness 30/100
realpython/pytest-mypy#23 · 1 comment · 2 reactions ·
All issues in realpython/pytest-mypy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Openarea: ci bug perceived difficulty: 3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ClickHouse/clickhouse-connect#1057 ·