-
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
Python test framework #20701
Comments
@EspritElf If you run unittest from terminal is it able to find it? I suspect that tests being under
Run the above command and see if it is able to find the tests. If that works then make sure that unittest args in settings.json looks like that. IF not adjust the arguments till it does and then use it in settings.json. |
Hello Karth, Still no luck inside VS code. I am using Django and I suspect one issue may be that Django's configuration settings aren't being set when using the python
and got this error:
I have an The only way I'm able to run tests is using manage.py with the command:
I think my best solution is to use a batch file to run tests using manage.py. Thanks for looking into this. |
Hello @EspritElf! It seems you are running into the issue we see with not supporting Django testing. This is something that has recently raised a lot of interest and moved up in priority so we will hopefully get to it in the near future. Feel free to keep up to date with our repo and specifically the PRs and issues related to Django testing to follow along with progress and help if you feel inclined. Thanks! |
Hi Eleanor, |
@EspritElf That PR #20675 cannot be taken directly. There are other ways to set django setting programmatically by directly calling There is another issue with the way unittest discovery works currently. It prints out the discovered content to stdout. This becomes a problem when you have frameworks that can alter the output. Libraries printing out to stdout via the logging apis in python that can break our parsing. So, we need a way to directly hook into the suite processing in django, and do it in a way that does not interfere discovery and execution of tests from command line. We are currently looking for ways to do this generally, so it can work for any manner of configuration for |
Hi @EspritElf, revisiting this issue and the ask seems the same as #73 so I am going to close this in favor of that long-standing issue. Updates on django test support will be made there and fingers crossed it can be soon. Thanks |
Type: Bug
Python unit testing framework doesn't enable unit testing. Flask icon only appears when entering debug mode, but still can't Configure Python Tests. The button is there, but once the unint test settings questions are answered, nothing happens.
test_urls.py.-.test-django.-.Visual.Studio.Code.2023-02-14.21-24-12.mp4
Extension version: 2023.2.0
VS Code version: Code 1.75.1 (441438abd1ac652551dbe4d408dfcec8a499b8bf, 2023-02-08T21:32:34.589Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: No
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_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: