-
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
Extension doesn't use MANAGE_PY_PATH #24214
Comments
@oaahmad The
|
@karthiknadig Thank you, but that wasn't the issue. I tried moving the Here is my directory structure now: And here is the same error still happening, even with that directory structure: Besides, the
|
I'm not sure either because that's not what happens for me 😕. I get the error in other projects too. Maybe the Python extension is caching something in a weird way? I will try on my personal Macbook and let you know how that goes (so far I have been trying on my work Macbook). |
@karthiknadig I get the error on my personal laptop as well. So it happens on both. They are both Macbooks with Apple Silicon (M-series chips). So they are both on ARM if that matters. They are both on the latest version of macOS. My Python extension is installed inside my dev container if that makes a difference. I only activated my Python extension for the workspace (not globally), but I don't think that matters. I don't know what else I can look for, but it's just not working for me no matter what I try. Let me know if you think of something I can check. Thanks. |
Since you are in a dev container could you just remove the
|
@karthiknadig I figured something out actually. I commented out my user-level settings for VS Code and it works now. I will try to figure out which setting the issue is and let you know so we can figure out if it's a bug or a user error on my part |
@karthiknadig I figured out which setting causes the issue. It's a weird one. When I comment out this setting:
It works fine. When I enable the setting, it breaks. I tried multiple times in both states. So that seems like a bug with the extension or with VS Code. But at least I have a short term solution. Thanks for your help. Let me know if I should create a separate issue for that or if we should keep this one open. |
Tagging @eleanorjboyd because I think she did most of the work enabling test discovery for Django. Maybe she'll have some ideas about what's going on. |
thank you for the investigation! Yes, that is a weird setting to cause an issue since the two should have no impact on eachother. I will give this a try and get back to you, thanks for your help! |
Was having the same problem with test discovery. |
Hi all, Chiming in with a reproduction! I just bumped into this earlier today...
Workaround confirmed:
Happy to assist in addressing this, assuming it is considered a bug. |
Type: Bug
Behaviour
Overview
Unittest discovery fails for Django tests when following these instructions. At least, they fail for me in projects that use a Python virtualenv inside a dev container where
manage.py
is not at the root of the project. I'm not sure which of those factors (if any) is relevant. I was able to reproduce the issue by creating this minimal example project: https://github.com/oaahmad/sample-django-project .Steps to reproduce:
Expected Behaviour
test_sample
test should be visible in the Testing viewActual Behaviour
Screenshot:
Additional Information
The tests run without issue from the integrated terminal with
./manage.py test --noinput
(from the/home/ubuntu/sample-django-project/src
directory). Here is the output:This is part of the output in
Output
->Python
(I will paste the full output under "Diagnostic Data"):This makes it seem like the Python extension is trying to run the tests as regular unit tests instead of using
manage.py
. However, I specifyMANAGE_PY_PATH
in a.env
file, and I set"python.envFile"
to that file's path (see the example project).I tried rebuilding the dev container "without cache" multiple times. I tried different Python versions, and different Ubuntu versions for the container. I tried with both a custom user and with the
ubuntu
user that comes with Ubuntu 24. I tried with both Python's builtinvenv
package and thevirtualenv
package. I got the same issue every time.Diagnostic data
Output from
Python
in theOutput
panelExtension version: 2024.14.1
VS Code version: Code 1.93.1 (Universal) (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z)
OS version: Darwin arm64 24.0.0
Modes:
Remote OS version: Linux arm64 6.10.4-linuxkit
python.languageServer
setting: DefaultUser Settings
Installed Extensions
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
The text was updated successfully, but these errors were encountered: