[Pytest] Add an inline error indicating the location in code where test discovery failed #19401
Labels
area-testing
community ask
Feature request that the community expressed interest in
feature-request
Request for new features or functionality
info-needed
Issue requires more information from poster
needs proposal
Need to make some design decisions
If there is a runtime error that occurs when discovering tests, it is quite a hassle to determine the point at which it failed.
The current method
Open the
Output > Python
log and scroll back until you find the spot where Pytest failed to discover your tests. Or alternatively, launch a terminal and runpytest
yourself and search through its output to find the error.My proposition
When Pytest discovery fails, the output is parsed to determine the location where it failed, so that an inline error can be created on that line of code. This makes it easier to spot issues that are causing Pytests to fail to run. Preferably, a quick link to that position would be provided for when you click on "Pytest discovery failed" in the testing panel, and the full details of the error would be provided within the inline error.
Adding this improvement would greatly simplify the process of finding errors when Pytest fails to run, especially for when those errors aren't picked up by the main language server (eg logical errors, or some issues with type hinting).
The text was updated successfully, but these errors were encountered: