-
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
Cannot discover tests anymore, python executable not used #22618
Comments
I don't know if this is the same issue, but I get this output:
This started happening right after I upgraded VSCode today. I wonder if it introduced stricter roles for subprocesses? |
My issue does not seem to be related to access rights. Some updates. I rebooted my computer, because why not, and the issue changed a bit. Now at least it tries to scan for tests, but finds 0. However, now the tests can be run individually from the editor (the run test arrow pops up at the test definition code). By the way, from the terminal I can still run the test suite using |
Have encountered the same exact issue after the latest update of vscode. It looks like the discovery command that vscode is executing is wrong. From the terminal I can see it is executing
However it works if I change that to the following and run it manually in my terminal:
|
Happened to me too, downgrading Python extension to 2023.20 solves the issue, so bug is in 2023.22 extension version.
Python extensions tested:
edit: If we can provide any logs, please let us know |
Can confirm the same behaviour that @eff917 mentions. Downgrading is the easiest way to mitigate, it seems. |
I had a similar problem today with pytest. No errors in the Output console though. It just said this:
But nothing happened. To work around it, I disabled the new test adapter experiment by adding this to my VSCode user settings:
After adding this (and restarting VSCode), Python tests were discovered correctly. And, I can't explain why, but I went back and removed that setting and test discovery is now working with the new test adapter. 🤷
|
This is also happening for me on Sonoma 14.2. Downgrading the Extension to 2023.20 fixed the issue |
Editing
|
Same problem as @kristiandupont here |
Hello everyone, sorry for the delay and lets figure out the problem here. It seems that @johansmolinski with @kristiandupont, it seems you are running the old discovery, can you please try and run the new testing experiment. Your logs reference @johansmolinski, can you include logs from this run "Now at least it tries to scan for tests, but finds 0". Please set log level to trace via the command palette. @AndreasHaure and @M3ssman same as @kristiandupont, try to switch to new experiment. @eff917, @nmost, and @danibishop if you could provide logs that would be great, if you could also set log level to trace via the command palette. @bricker, interesting a re-start worked, let me know if you see this behavior pop up again. Thanks everyone for engaging on this issue! |
I reproduce the same symptom and I found what mades a difference for me is how I open vscode for my project. If I open VSCode first, and then select the pre-existing virtualenv, I can make test discovery to work. However, my typical using the /usr/local/bin/code (already in my path, so i just code .) Like others, if i revert to earlier vscode python extension More specifically. before I use |
Hello everyone, I am able to repro the issue and am in the process of narrowing down what commit in release 2023.22.0 is causing the issue. I will send updates in this issue. The issue is the wrong path is put for the python executable: |
I am only able to repro with @smoy steps using |
So glad I found this thread! Been struggling with this for the last few hours. As others have commented, if I launch VS Code from the terminal using |
@karrtikr I can confirm switching to pre-release version resolve the test discovery issue. |
…g" (microsoft#22638) Reverts microsoft#22413 microsoft#22618 Turns out we still need this code for old deprecated APIs that we expose, one of which is used in testing.
@eleanorjboyd I have the issues described here and I am doing what you say. |
@stuartmaxwell - works for me. The "Testing" explorer was first still at the "No tests were found...", so I thought it didn't work but after a few seconds it loaded the tests. thanks! |
Also confirmed, |
closing as the point release contains the fix to this issue. Please comment if you are still experiencing problems even on the point release. Thanks |
Type: Bug
Behaviour
Expected vs. Actual
Expected: Clicking the tests icon should discover tests.
Actual: No tests have been found in this workspace yet.
Steps to reproduce:
Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2023.22.0
VS Code version: Code 1.85.0 (Universal) (af28b32d7e553898b2a91af498b1fb666fdebe0c, 2023-12-06T18:18:04.614Z)
OS version: Darwin arm64 23.1.0
Modes:
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: