VS Code Support for pytest-ruff #32
Unanswered
eleanorjboyd
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I am the maintainer of testing for vscode-python and have been investigating: microsoft/vscode-python#23933. I see from your other discussion that you are excited to get support on VS Code for this extension which is great! Love to see that.
I explained a bit in the attached issue but what I think the best fix is would be including an extra "ruff" test node nested under each file node on the test explorer. We run tests based on their test-ids, so this would mean the ruff 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 ruff 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, the ruff test is the RuffItem and its parent is the RuffFile. When building the tree what I want to do is combine the RuffFile object with the existing pytest.File object. Does this make sense to do or is there any information stored in the RuffFile that makes it different from the pytest.File object?
The steps I have now:
I am having trouble with number 3 because the RuffItem's parent is a RuffFile so I was just going to move the RuffItem to be a child of the related pytest.File. This should work if I test equality by path but will cause a problem if the ruff item is the only node (therefore a file node wont be constructed which I can attach it to). Therefore I was wondering if there is a way to convert a RuffItem to a pytest.File?
I could change the map implementation but wanted to check in here first to see if there was another option. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions