Add initial support for pytest plugins #18217
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds initial support for pytest plugin-generated tests, including running and debugging tests, and opening tests in the editor (even if the location is a non-Python file).
Debugging non-Python files still isn't supported.
This PR has the consequence of making nodeids not always be unique, because a plugin could always generate multiple tests with the same name in the same suite. Most of the code seems to assume that they will be unique, though, because the UI only shows only one test even when multiple tests have the same nodeid.
I don't know what the ideal solution for that is, because the current behavior has some strange consequences when interacting with tests with repeated nodeids, but repeating nodeids seems like a bug considering that the pytest docs say that nodeids are supposed to be unique:
Work on #16742 and #16852
Both of those tests mention crashes with specific plugins, but I haven't tested any of those plugins so I don't know if those crashes are fixed.