-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unable to discover using pytest #20750
Comments
The error just means that the interpreter which is selected: Also, how is that interpreter created? |
Thanks for your reply, I will check and get back to you! |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I see, try using the full path Reassigning this to testing. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Hi,
|
What happens when you run this from your integrated terminal? |
Hi @eleanorjboyd - I experienced a similar if not the same problem. This is also described in the issue #20913, which is exactly the problem i have. It seems to be related to a importing an object and executing code at import time. (the "Global Object Pattern") You can reproduce it with these two files:
and the test,
you will need to set PYTHONPATH AND PYSPARK_PYTHON in your
Here is the full output I get, including the stack trace:
If I remove the global object import and instead create it as a fixture, it works. In fact, if I edit the files to work around the issue and the tests are discovered, I can then still run and debug the tests - but the discovery error is there anyway. Thanks and I hope this helps. Kevin |
Hi! This should be fixed by our rewrite of the testing logic which is close to completion, you can follow along for updates here: #17242 |
Thanks! Looking forward to it |
Hello! We have just finished our testing rewrite and are beginning the roll out to users. If you are able, it would be very helpful to know if your issue still exists on the rewrite! To try it yourself, you need to be on the most recent release of the Python extension and add this setting to your users You can confirm you have the rewrite enabled by setting Let me know if the rewrite fixes your issue. Thanks! |
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off. Happy Coding! |
Discussed in #20744
Originally posted by weimin February 23, 2023
I got this error in vscode, I checked this in this repo and also on stackoverflow but could not find the fix:
My vscode is Version: 1.74.3 (Universal) and my python extension is v2022.20.2
The text was updated successfully, but these errors were encountered: