-
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
virtual env is ignored while testing #23408
Comments
Identical problem since I updated VS Code yesterday. My PyTest is borked on VSCode (but works fine on the terminal). |
@cupcat121 it looks like you have set a path to If you have a Is there any reason you want a venv without pip? |
@cupcat121 Also doing Note: If you create virtual environment using VS Code Create environment command, it can try to install |
@karthiknadig - are you suggesting that if I use VS Code Create vs. my own bespke virtual env, pytest should work fine? |
@tzaffi Not really. If you have a User It will start My suggestion is remove the global |
Note that although Run Test action does not execute pytest in the select venv's environment the Debug Test action does . See #23467. |
Hey @eleanorjboyd, this issue might need further attention. @cupcat121, you can help us out by closing this issue if the problem no longer exists, or adding more information. |
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! |
Thanks Eleanor. The underlying problem #23467 (Run Test not "honouring" the specified venv as"Debug Test" does) is pretty clear. |
Type: Bug
Behaviour
Even if I installed pytest in the venv and selected the interpretor, it still use the pytest of my system while testing. I had to modify
python.testing.pytestPath
to${workspaceFolder}/.venv/bin/pytest
to get it worked.There is no error performing my tests in the terminal within the venv activated
Steps to reproduce:
pip install -e
from myproject import foo
Diagnostic data
python test log panel
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.7.11301009
VS Code version: Code - Insiders 1.90.0-insider (ccba2fc85c14bedeef5a72b7ebc0bde9b0e91948, 2024-05-06T08:06:22.239Z)
OS version: Linux x64 6.8.9-zen1-1-zen
Modes:
python.languageServer
setting: PylanceUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: disabled_off
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
The text was updated successfully, but these errors were encountered: