Skip to content

Django tests run, but don't gather coverage #24804

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

Closed
OutOfFocus4 opened this issue Feb 10, 2025 · 1 comment
Closed

Django tests run, but don't gather coverage #24804

OutOfFocus4 opened this issue Feb 10, 2025 · 1 comment
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@OutOfFocus4
Copy link

Type: Bug

Behaviour

The new test adapter properly runs Django tests, but fails to gather coverage data from those tests.

Steps to reproduce:

  1. Create a new directory /tmp/poc
  2. Create and activate a Python virtual environment:
    python -m venv /tmp/poc/.venv
    source /tmp/poc/.venv/bin/activate
  3. Install Django and coverage
    pip install django coverage
  4. Create a new Django project
    django-admin startproject poc /tmp/poc
  5. Create the file /tmp/poc/.env with the following:
    MANAGE_PY_PATH=/tmp/poc/manage.py
  6. Create a file /tmp/poc/poc/tests.py with the following:
    from django.test import TestCase
    
    class POCTest(TestCase):
        def test_poc(self):
            pass
  7. Create the file /tmp/poc/.vscode/settings.json with the following:
    {
        "python.testing.unittestEnabled": true,
        "python.testing.unittestArgs": [
        ]
    }
  8. Open the poc project in VS Code
  9. Once the tests are configured, the POCTestCase should be in the testing panel. Run it with coverage
  10. The test will succeed, but the coverage for all files except /tmp/poc/poc/__init__.py will be 0%.

Extension version: 2025.0.0
VS Code version: Code 1.97.0 (Universal) (33fc5a94a3f99ebe7087e8fe79fbe1d37a251016, 2025-02-04T22:41:26.688Z)
OS version: Darwin arm64 24.3.0
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.11.6
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

experiments
• enabled: false

Installed Extensions
Extension Name Extension Id Version
black-formatter ms- 2024.6.0
cpptools ms- 1.23.6
debugpy ms- 2025.0.0
isort ms- 2023.10.1
js-debug ms- 1.97.0
js-debug-companion ms- 1.1.3
python ms- 2025.0.0
remote-explorer ms- 0.4.3
remote-ssh ms- 0.117.0
remote-ssh-edit ms- 0.87.0
rust-analyzer rus 0.3.2299
vscode-js-profile-table ms- 1.0.10
vscode-pylance ms- 2025.2.1
vscode-yaml red 1.16.0
System Info
Item Value
CPUs Apple M1 Max (10 x 2400)
GPU Status 2d_canvas: enabled
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
Load (avg) 4, 3, 2
Memory (System) 32.00GB (2.37GB free)
Process Argv --crash-reporter-id 2c081035-5e61-4ab4-8517-c976790ae1b3
Screen Reader no
VM 0%
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 10, 2025
@eleanorjboyd
Copy link
Member

coverage not yet supported with Django: #24199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants