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

PyTest discovery can fail but not give any clue as to what the problem is #12043

Closed
rchiodo opened this issue May 28, 2020 · 2 comments · Fixed by #16769
Closed

PyTest discovery can fail but not give any clue as to what the problem is #12043

rchiodo opened this issue May 28, 2020 · 2 comments · Fixed by #16769
Assignees
Labels
area-testing feature-request Request for new features or functionality needs proposal Need to make some design decisions verified Verification succeeded
Milestone

Comments

@rchiodo
Copy link

rchiodo commented May 28, 2020

If there's a bug in my code, I can get this message:
image

What I really need is this error which is in the Python Test log

ImportError: cannot import name 'today' from 'datetime' (C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\datetime.py)

It would be nice if this was surfaced somewhere. Either by having a link to jump to this output panel on the error (instead of checking the configuration) or even better showing the error in the problems panel.

@rchiodo rchiodo added feature-request Request for new features or functionality triage-needed Needs assignment to the proper sub-team labels May 28, 2020
@LightCC
Copy link

LightCC commented May 30, 2020

Here is how the "Test Explorer UI" extension handles this situation. The Python extension should do something similar:

The extensions I have:
image

When there is a discovery error, a line is shown in the Test Sidebar window:
image

If you double-click this line in the test explorer window, it opens the Output window to the "Test Explorer" pane, and shows the output from the attempt to discover tests:

image

With Python, it just shows a blank screen in the Sidebar:

image

And the results do appear in the "Python Test Log" pane in the Output window, which you can get to by clicking the "show test output" icon, the second from the right:

image

But it could certainly be made a more obvious.

I had lots of problems figuring out how to find test discovery error information, and a lot of frustration, when I started using VS Code seriously for Python.

Making an improvement here would reduce a lot of issues logged here by newer users who don't understand how to find the test discovery failure information, like the user who originally posted this.

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jun 1, 2020
@brettcannon
Copy link
Member

Thank you for the suggestion! We have marked this issue as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 👍 votes the opening comment gets to help us make our decision.

@luabud luabud added needs proposal Need to make some design decisions and removed needs decision labels Jun 24, 2020
@luabud luabud self-assigned this Aug 12, 2020
@karthiknadig karthiknadig added verification-found Issue verification failed verification-needed Verification of issue is requested labels Jul 29, 2021
@brettcannon brettcannon removed the verification-found Issue verification failed label Aug 3, 2021
@karthiknadig karthiknadig added verified Verification succeeded and removed verification-needed Verification of issue is requested labels Aug 3, 2021
@karthiknadig karthiknadig added this to the August 2021 milestone Aug 5, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing feature-request Request for new features or functionality needs proposal Need to make some design decisions verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants