Repository navigation
Django Testing Error #24657
Description
Activity
- addedtriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
on Dec 24, 2024 I also tried from my host system, a Windows machine, without using the dev container, and I get the same error only on Windows.
2024-12-24 19:08:58.483 [info] Discover tests for workspace name: EDDAI-EliteDangerousApiInterface - uri: c:\Users\fabio\Documents\GitHub\EDDAI-EliteDangerousApiInterface
2024-12-24 19:08:58.483 [info] Running discovery for unittest using the new test adapter.
2024-12-24 19:08:58.488 [info] > ~\miniconda3\Scripts\conda.exe run -p ..conda --no-capture-output python ~.vscode\extensions\ms-python.python-2024.22.1-win32-x64\python_files\get_output_via_markers.py ~/.vscode/extensions/ms-python.python-2024.22.1-win32-x64/python_files/printEnvVariables.py
2024-12-24 19:08:58.488 [info] shell: commandPrompt
2024-12-24 19:09:00.437 [info] Discovering unittest tests for workspace c:\Users\fabio\Documents\GitHub\EDDAI-EliteDangerousApiInterface with arguments: c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\python_files\unittestadapter\discovery.py,--udiscovery,-p,test.py2024-12-24 19:09:00.437 [info] > ~\miniconda3\Scripts\conda.exe run -p ..conda --no-capture-output python ~.vscode\extensions\ms-python.python-2024.22.1-win32-x64\python_files\get_output_via_markers.py ~.vscode\extensions\ms-python.python-2024.22.1-win32-x64\python_files\unittestadapter\discovery.py --udiscovery -p test.py
2024-12-24 19:09:00.437 [info] cwd: .
2024-12-24 19:09:02.290 [info] >>>PYTHON-EXEC-OUTPUT2024-12-24 19:09:02.469 [info] MANAGE_PY_PATH is set, running Django discovery with path to manage.py as: $C:\Users\fabio\Documents\GitHub\EDDAI-EliteDangerousApiInterface\eddai_EliteDangerousApiInterface\manage.py
2024-12-24 19:09:02.469 [info] Running Django tests with command: ['c:\Users\fabio\Documents\GitHub\EDDAI-EliteDangerousApiInterface\.conda\python.exe', 'C:\Users\fabio\Documents\GitHub\EDDAI-EliteDangerousApiInterface\eddai_EliteDangerousApiInterface\manage.py', 'test', '--testrunner=django_test_runner.CustomDiscoveryTestRunner', '-p', 'test.py']
2024-12-24 19:09:04.638 [error] Test Discovery named pipe \.\pipe\python-test-discovery-c8d35517c3a59356ecbe error: TypeError: Cannot read properties of null (reading 'path')
at e (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:963511)
at t.PythonResultResolver._resolveDiscovery (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:942532)
at t.PythonResultResolver.resolveDiscovery (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:941616)
at c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:1011606
at _._callback (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:962221)
at b.callback (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:204363)
at Object.thunk (c:\Users\fabio.vscode\extensions\ms-python.python-2024.22.1-win32-x64\out\client\extension.js:2:2057316)
2024-12-24 19:09:04.852 [error]2024-12-24 19:09:04.853 [info] Found 0 test(s).
<<<PYTHON-EXEC-OUTPUT
The Conda environment was created from VSCode by clicking on "Create Virtual Environment" and selecting Conda.
- addedbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
on Dec 25, 2024 Hi! This is very interesting, here are some of my thoughts. First, it seems you get it on both machines so it is likely not a permissions error but we see similar errors for permissions so that could be a reason. What would help is if you could test it from the command line to see if you can get a result there. First you will need to add the parent folder of the script we are using to your python path. It should be somewhere here
~/.vscode-insiders/extensions/ms-python.python-2024.22.1-darwin-arm64/python_files/unittestadapter(with different versions and maybe .vscode not .vscode-insiders).. Now run the command your logs included hereRunning Django tests with command: ['/opt/conda/bin/python', '/workspaces/EDDAI-EliteDangerousApiInterface/eddai_EliteDangerousApiInterface/manage.py', 'test', '--testrunner=django_test_runner.CustomDiscoveryTestRunner', '-p', 'test.py']as a string with spaces. Let me know how that goes. Thanks!- addedinfo-neededIssue requires more information from posterIssue requires more information from poster
on Jan 6, 2025 Hi,
I’ve run the test you asked for. Below is the terminal output:As you can see, at the beginning, I looked for the directory you mentioned. Then, I added the main folder of the script, went back to the project directory, and executed the command. Let me know if I followed the steps correctly and if there’s anything else I can do to help you resolve the issue.
Thank you for your support.
- removedinfo-neededIssue requires more information from posterIssue requires more information from poster
on Jan 7, 2025 lukasz-karolewski commented
on Apr 4, 2025 More actionsi have the same problem:
PYTHONPATH seems to be set correctly, i've added print() inside manage.py2025-04-04 21:23:58.685 [info] Discover tests for workspace name: test_project - uri: /workspace/test_project 2025-04-04 21:23:58.690 [info] Discovering unittest tests for workspace /workspace/test_project with arguments: /root/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/python_files/unittestadapter/discovery.py,--udiscovery,-v,2 2025-04-04 21:23:58.743 [info] > /usr/local/python/current/bin/python ~/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/python_files/unittestadapter/discovery.py --udiscovery -v 2 2025-04-04 21:23:58.743 [info] cwd: . 2025-04-04 21:23:58.785 [info] MANAGE_PY_PATH is set, running Django discovery with path to manage.py as: $./django/manage.py 2025-04-04 21:23:58.785 [info] Running Django tests with command: ['/usr/local/python/current/bin/python', './django/manage.py', 'test', '--testrunner=django_test_runner.CustomDiscoveryTestRunner', '-v', '2'] 2025-04-04 21:23:59.394 [error] Test Discovery named pipe /tmp/python-test-discovery-683bf85fbd22591ff3c2 error: TypeError: Cannot read properties of null (reading 'path') at e (/root/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/out/client/extension.js:2:931664) at t.PythonResultResolver._resolveDiscovery (/root/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/out/client/extension.js:2:916288) at t.PythonResultResolver.resolveDiscovery (/root/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/out/client/extension.js:2:915372) at /root/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/out/client/extension.js:2:967569 at b.callback (/root/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/out/client/extension.js:2:931208) at Object.thunk (/root/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/out/client/extension.js:2:1985138) 2025-04-04 21:23:59.507 [error] 2025-04-04 21:23:59.508 [info] PYTHONPATH: /root/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/python_files/unittestadapter 2025-04-04 21:23:59.509 [info] Using settings: test_project.settings.test Found 0 test(s).i've tried running from terminal directly:
test_project git:(dev) ✗ PYTHONPATH=/root/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/python_files/unittestadapter /usr/local/python/current/bin/python django/manage.py test --testrunner=django_test_runner.CustomDiscoveryTestRunner -v 2 PYTHONPATH: /root/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/python_files/unittestadapter Using settings: test_project.settings.test UNITTEST ERROR: TEST_RUN_PIPE is not set at the time of unittest trying to send data. Please confirm this environment variable is not being changed or removed as it is required for successful test discovery and execution.TEST_RUN_PIPE = None Traceback (most recent call last): File "/workspace/test_project/django/manage.py", line 16, in <module> execute_from_command_line(sys.argv) File "/usr/local/python/3.12.9/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/usr/local/python/3.12.9/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/local/python/3.12.9/lib/python3.12/site-packages/django/core/management/commands/test.py", line 24, in run_from_argv super().run_from_argv(argv) File "/usr/local/python/3.12.9/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv self.execute(*args, **cmd_options) File "/usr/local/python/3.12.9/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute output = self.handle(*args, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/python/3.12.9/lib/python3.12/site-packages/django/core/management/commands/test.py", line 63, in handle failures = test_runner.run_tests(test_labels) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.vscode-server/extensions/ms-python.python-2025.4.0-linux-x64/python_files/unittestadapter/django_test_runner.py", line 46, in run_tests raise VSCodeUnittestError(error_msg) pvsc_utils.VSCodeUnittestError: UNITTEST ERROR: TEST_RUN_PIPE is not set at the time of unittest trying to send data. Please confirm this environment variable is not being changed or removed as it is required for successful test discovery and execution.TEST_RUN_PIPE = None``` settings: ```"python.experiments.optInto": ["pythonTestAdapter"], "python.testing.promptToConfigure": false, "python.testing.unittestArgs": ["-v", "2"], "python.testing.pytestEnabled": false, "python.testing.unittestEnabled": true, "python.envFile": "${workspaceFolder}/django/.env",```Reacted by yff111- addedconfirmation pendingThe issue needs to be confirmed through a maintainer reproducing the bug.The issue needs to be confirmed through a maintainer reproducing the bug.
on Dec 12, 2025 - removedtriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
on Mar 13, 2026 🤖 Thanks for the report and the additional reproduction. Current main now avoids the
Cannot read properties of null (reading 'path')exception when Django discovery returns a null test tree, but that change does not establish whether your tests are now discovered. Could you confirm this with the current Python extension or pre-release and provide a minimal Django project plus the latest Python output-channel log if it still finds zero tests? Issues markedinfo-neededautomatically close after 30 days without a reply.- addedinfo-neededIssue requires more information from posterIssue requires more information from poster
on Sep 23, 2026
Type: Bug
I am trying to use the Django testing feature implemented in August, but I am encountering difficulties. I am using a Conda environment inside a dev container that utilizes this image: continuumio/miniconda3:latest. However, when I try to run the tests, I get the following errors:
2024-12-24 17:49:50.742 [info] Discover tests for workspace name: EDDAI-EliteDangerousApiInterface - uri: /workspaces/EDDAI-EliteDangerousApiInterface
2024-12-24 17:49:50.742 [info] Running discovery for unittest using the new test adapter.
2024-12-24 17:49:50.756 [info] > conda run -n base --no-capture-output python ~/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/printEnvVariables.py
2024-12-24 17:49:50.756 [info] shell: bash
2024-12-24 17:49:51.896 [info] Discovering unittest tests for workspace /workspaces/EDDAI-EliteDangerousApiInterface with arguments: /root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/unittestadapter/discovery.py,--udiscovery,-p,test.py
2024-12-24 17:49:51.896 [info] > conda run -n base --no-capture-output python ~/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/python_files/unittestadapter/discovery.py --udiscovery -p test.py
2024-12-24 17:49:51.896 [info] cwd: .
2024-12-24 17:49:52.914 [info] >>>PYTHON-EXEC-OUTPUT
2024-12-24 17:49:52.947 [info] MANAGE_PY_PATH is set, running Django discovery with path to manage.py as: $/workspaces/EDDAI-EliteDangerousApiInterface/eddai_EliteDangerousApiInterface/manage.py
2024-12-24 17:49:52.951 [info] Running Django tests with command: ['/opt/conda/bin/python', '/workspaces/EDDAI-EliteDangerousApiInterface/eddai_EliteDangerousApiInterface/manage.py', 'test', '--testrunner=django_test_runner.CustomDiscoveryTestRunner', '-p', 'test.py']
2024-12-24 17:49:57.044 [error] Test Discovery named pipe /tmp/user/0/python-test-discovery-a8be1522eb245c648034 error: TypeError: Cannot read properties of null (reading 'path')
at e (/root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:963511)
at t.PythonResultResolver._resolveDiscovery (/root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:942532)
at t.PythonResultResolver.resolveDiscovery (/root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:941616)
at /root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:1011606
at b.callback (/root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:962221)
at Object.thunk (/root/.vscode-server/extensions/ms-python.python-2024.22.1-linux-x64/out/client/extension.js:2:2057316)
2024-12-24 17:49:57.186 [error]
2024-12-24 17:49:57.186 [info] Found 0 test(s).
<<<PYTHON-EXEC-OUTPUT
I don't think this is an issue caused by the dev container. Below, I am also providing the environment.yml file from Conda with my dependencies to help you understand the problem:
`channels:
dependencies:
Lastly, I am including the Docker file that generates my dev container for completeness.
FROM continuumio/miniconda3:latest
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi
&& rm -rf /tmp/conda-tmp
Extension version: 2024.22.1
VS Code version: Code 1.96.2 (fabdb6a30b49f79a7aba0f2ad9df9b399473380f, 2024-12-19T10:22:47.216Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2
python.languageServersetting: 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
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments