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

VS Code Support for pytest-mypy #190

Open
eleanorjboyd opened this issue Jan 7, 2025 · 0 comments
Open

VS Code Support for pytest-mypy #190

eleanorjboyd opened this issue Jan 7, 2025 · 0 comments

Comments

@eleanorjboyd
Copy link

Hello!
I am the maintainer of testing for vscode-python and have been investigating: microsoft/vscode-python#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: businho/pytest-ruff#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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant