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

TestCase not show in Python Test Explorer and CodeLens adornments If one of pytest testcases got error during testcase discorver process #179

Closed
baiyyee opened this issue Aug 23, 2020 · 7 comments

Comments

@baiyyee
Copy link

baiyyee commented Aug 23, 2020

For Example, I have 1000 pytest testcases in my project, but only one of them got error (like code defect, or logic issues, and so on...) cause testcase discorvery failed, For now, looks all testcases will not shown in Python Test Explorer List, and CodeLens adornments also not appeared within my testcase code, So It's hard for me to run or debug a normal (not the error testcase), I have to use other debuger tools like ipdb to debug my code. In this case, can we show the normal testcase and just exclude the error(s) in Python Test Explorer List? It's really hard for me if one case failures cause all testcases collect failed.

screenshots:
Snipaste_2020-08-23_12-07-01

@kondratyev-nv
Copy link
Owner

@SilenceHe Thank you for the issue. It looks like you're using Test Explorer from the Python Extension and not the Python Test Explorer. In case you're using Python extension to discover and run your tests, please, report the error to them - https://github.com/Microsoft/vscode-python.

However, if you have Python Test Explorer installed it should show any tests with errors to you. It looks like this
image

If Python Test Explorer does not show any tests, please, look at messages at Python Test Adapter Log in the Output section. It would be of help if you show the errors from that log and your settings (like python.pythonPath).

@baiyyee
Copy link
Author

baiyyee commented Sep 26, 2020

Test Explorer UI and Python Test Explorer both installed (looks Python Test Explorer depends on Test Explorer UI), and parts of cases got errors in Python Test Log Console, There's nothing shows in Test Explorer List If I'm not fix the errors.

image

@baiyyee
Copy link
Author

baiyyee commented Sep 26, 2020

Filed another bug for your advice here: microsoft/vscode-python#14116

@kondratyev-nv
Copy link
Owner

@SilenceHe Thank you for clarification. Can you please take a look at messages at Python Test Adapter Log in the Output section and send the output here? Also, your showing your configuration from settings.json might be of help.

@baiyyee
Copy link
Author

baiyyee commented Sep 27, 2020

Thanks Nikolay Kondratyev, Python Test Adapter Log complains about 'pytest not installed', It works well after I set python.pythonPath to Python venv path, because pytest was installed in venv.

@baiyyee baiyyee closed this as completed Sep 27, 2020
@kondratyev-nv
Copy link
Owner

@SilenceHe Glad you've resolved it! Just to be sure, does test discovery works for you even when you have tests with errors now?

@baiyyee
Copy link
Author

baiyyee commented Sep 28, 2020

Yes, It works, even some cases got errors.

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

2 participants