-
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
[Pytest] Tests not being discovered due to pytest_report hook #22650
Comments
Hi! From my understanding what this error message Referring to pytest documentation here, it shows that I am seeing from your stdout that your version are |
Hello, I'm encountering the same bug (also python 3.7 but cannot upgrade the version since this is for a maintenance branch of a product and that's where dev-containers are useful !)
This is probably related to "Experiment 'pythonTestAdapter' is active" ? Anyway it would be nice to have a fix other than "upgrade the python version" if possible ;-) |
I can also confirm that setting |
same here(with no obvious error in python output, though). for Before (and after) that running |
@peacefulseeker, are you no longer seeing the same error regarding using python 3.7? If you are not please create a new issue with your project structure and logs so I can better assist, thanks! |
@vanackere in terms of a fix you can also pin the python extension version which is compatible with 3.7: Hello! For the python extension we follow python.org and their schedule on which version we support. Here is their supported versions, https://devguide.python.org/versions/, and 3.7 has reached end of life for support. This means new releases of our extension will be compatible back to 3.8 as of now. As a work around, you can pin the version of the python extension which still worked for you with 3.7. You can see in the release notes of v2023.18.0 we dropped Python 3.7 support https://github.com/microsoft/vscode-python/releases so the previous version might be the best version to pin. |
Yes, the issue is gone(for pytest) after I've opted out from |
Are you able to get it working still in the experiment? We will soon switch to fully using the rewrite as our testing infrastructure which will disable the use of the experiment opt out as a work around. |
@eleanorjboyd : thanks for the hint, we'll try to pin the version in devcontainer.json My only fear with that approach is that the pinned extension might stop working with future version of VSCode, which will also be a problem for lot of other users working on legacy code base. For exemple Python 3.7 was the default python version on Debian 10 (end-of-life too... but on which one of our products has still a stable supported branch that we must maintain for several more years). How long can we be certain that the pinned extension will still be functional ? If there is a risk that the older extension would stop working, perhaps Microsoft could consider publishing a "Legacy" python extension that would still allow to work with older unsupported versions of python ? |
Looping in @brettcannon here as he can speak better to the future of our extension and VS Code as it relates to legacy python versions. |
No explicit guarantees, but VS Code itself takes API stability seriously, so there's no specific expectation an older version would stop working.
We implicitly already do that via the ability to install old versions of the extension. Otherwise maintaining support w/ older versions of Python becomes too costly time-wise based on the usage we see of old Python versions. |
What is the proper way to pin the version of the extension ? I've tried putting
In Also should I also pin ms-python.vscode-pylance to a specific version ? |
No, I was not able. Makes sense, that at a certain point, the test discovery is expected to be broken |
@vanackere , you should be able to use |
@peacefulseeker : manual installation works... but that's not really helpful since we need to ensure in the devcontainer.json file that the correct extension version is actually installed and don't want to require that every engineer in our company has to perform a manual setup each time they have to work on the legacy branch of our product... |
If your version of VS Code is too old then you may be hitting microsoft/vscode#63903 , otherwise it should work and you're hitting a bug in either VS Code or the devcontainer extension.
I honestly don't know for your specific case; Pylance has its own compatibility policy. But since they don't execute Python code to function, I suspect they can be more conservative than us. |
@brettcannon version of vscode is quite recent (Version: 1.85.1 Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2) This must be a bug in devcontainer extension then, i'll investigate and report |
@lubaroli, please let me know if your issue has been resolved in this discussion and if we can close the issue. thanks |
Thanks for the quick support @eleanorjboyd, I'm in exactly the same boat as @vanackere, working on legacy systems, but since python 3.7 is reaching EOL, I understand this is not a priority requirement and the issue can be closed. For now I'll pin the devcontainer extension as suggested and hope it is a feasible alternative for as long as it takes us to migrate our system. |
@brettcannon as a follow-up I can confirm that there is a bug that makes extension pinning not work in our case. I've reduced it to a very small reproducible case and opened an issue at microsoft/vscode#203457, I hope this can be prioritized and fixed soon (hopefully before the testing rewrite lands and fully breaks python 3.7 without any possible workaround for us 😰 ) |
@karthiknadig looping you in on this as you might have more understanding around the extension pinning |
Thanks for finding that bug. I can't make any promises around prioritizing that issue, but I will see what I can do. |
closing as the issue opened on core in regards to extension pinning has been resolved. Thanks! |
Type: Bug
Behaviour
After updating VS Code, VS Code Pytest is no longer discovering tests. Running Pytest on the terminal works as expected and tests are found correctly.
Expected vs. Actual
When running on ssh terminal, within Conda environment:
Output of VS Code after failing to discover tests:
Steps to reproduce:
Diagnostic data
python.languageServer
setting: PylanceOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2023.22.1
VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:49:37.021Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 3.10.0-1160.99.1.el7.x86_64
Remote OS version: Linux x64 3.10.0-1160.99.1.el7.x86_64
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: