microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.33k stars 1.19k forks source link

Using multiprocessing -> TypeError: Cannot read properties of null (reading 'testsuites') #23064

Closed MalteBecker closed 5 months ago

MalteBecker commented 8 months ago

Type: Bug

Behaviour

Expected vs. Actual

I get the Error TypeError: Cannot read properties of null (reading 'testsuites') when using the debug option in the test explorer and using the multiprocessing module. If I just execute the test, I don´t get the error.

I first created this bug at debugpy, but they ask to create it here because it looks like a typescript error: https://github.com/microsoft/debugpy/issues/1537

Steps to reproduce:

  1. Use this script:
    
    import time
    from multiprocessing import Pool

VALUES = [1, 2, 3, 4]

def do_something(bla: int): time.sleep(bla)

def test_multi(): with Pool() as pool: pool.map(do_something, VALUES)

def test_for(): for val in VALUES: do_something(val)

2. Configure pytest to find the tests.
3. Debug the "multi" test with the test explorer
=> Get the error `TypeError: Cannot read properties of null (reading 'testsuites')` in the "TEST RESULTS" tab.

<!--
**After** creating the issue on GitHub, you can add screenshots and GIFs of what is happening. Consider tools like https://www.cockos.com/licecap/, https://github.com/phw/peek or https://www.screentogif.com/ for GIF creation.
-->

<!-- **NOTE**: Everything below except Python output panel is auto-generated; no editing required. Please do provide Python output panel. -->
# Diagnostic data

-   Python version (& distribution if applicable, e.g. Anaconda): 3.9.18
-   Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
-   Value of the `python.languageServer` setting: Default

<details>

<summary>Output for <code>Python</code> in the <code>Output</code> panel (<code>View</code>→<code>Output</code>, change the drop-down the upper-right of the <code>Output</code> panel to <code>Python</code>)
</summary>

<p>

2024-03-13 08:40:33.923 [info] Telemetry level is off 2024-03-13 08:40:33.923 [info] Experiments are disabled, only manually opted experiments are active. 2024-03-13 08:40:33.923 [info] Default formatter is set to ms-python.black-formatter for workspace d:\git\pytest_error 2024-03-13 08:40:33.923 [info] Test server listening. 2024-03-13 08:40:33.924 [info] Python interpreter path: C:\Program Files\Python39\python.exe 2024-03-13 08:40:36.605 [info] Starting Pylance language server. 2024-03-13 08:41:09.657 [info] Discover tests for workspace name: pytest_error - uri: d:\git\pytest_error\test.py 2024-03-13 08:41:09.698 [info] > "C:\Program Files\Python39\python.exe" ~.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\testing_tools\run_adapter.py discover pytest -- --rootdir . -s --cache-clear test.py 2024-03-13 08:41:09.698 [info] cwd: . 2024-03-13 08:41:13.459 [info] Discover tests for workspace name: pytest_error - uri: d:\git\pytest_error\test.py 2024-03-13 08:41:13.487 [info] > "C:\Program Files\Python39\python.exe" ~.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\testing_tools\run_adapter.py discover pytest -- --rootdir . -s --cache-clear test.py 2024-03-13 08:41:13.488 [info] cwd: . 2024-03-13 08:47:18.574 [info] Discover tests for workspace name: pytest_error - uri: d:\git\pytest_error\test.py 2024-03-13 08:47:18.622 [info] > "C:\Program Files\Python39\python.exe" ~.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\testing_tools\run_adapter.py discover pytest -- --rootdir . -s --cache-clear test.py 2024-03-13 08:47:18.622 [info] cwd: . 2024-03-13 08:47:19.942 [info] Discover tests for workspace name: pytest_error - uri: d:\git\pytest_error 2024-03-13 08:47:19.994 [info] > "C:\Program Files\Python39\python.exe" ~.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\testing_tools\run_adapter.py discover pytest -- --rootdir . -s --cache-clear test.py 2024-03-13 08:47:19.994 [info] cwd: . 2024-03-13 08:47:22.587 [info] Using launch configuration in launch.json file. 2024-03-13 08:47:25.084 [info] Send text to terminal: & 'C:\Program Files\Python39\python.exe' 'c:\Users\MalteB.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher' '56011' '--' 'c:\Users\MalteB.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\testlauncher.py' 'd:\git\pytest_error' 'pytest' '--rootdir' 'd:\git\pytest_error' '--override-ini' 'junit_family=xunit1' '--junit-xml=C:\Users\MalteB\AppData\Local\Temp\tmp-24632zzJXToPkg4FX.xml' '--capture' 'no' './test.py::test_multi'


</p>
</details>

<details>

<summary>User Settings</summary>

<p>

languageServer: "Pylance"

testing • pytestArgs: "" • pytestEnabled: true



</p>
</details>

Extension version: 2024.2.1
VS Code version: Code 1.87.1 (1e790d77f81672c49be070e04474901747115651, 2024-03-06T00:21:36.258Z)
OS version: Windows_NT x64 10.0.19045
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|12th Gen Intel(R) Core(TM) i7-12850HX (24 x 2419)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|31.69GB (19.14GB free)|
|Process Argv|--folder-uri file:///d%3A/git/pytest_error|
|Screen Reader|no|
|VM|0%|
</details>
<!-- generated by issue reporter -->
eleanorjboyd commented 7 months ago

Hello! Could your include your full logs from the python output channel with the log level at trace? With these I can better help figure out what might be going wrong. Thanks

MalteBecker commented 7 months ago

Hello! Could your include your full logs from the python output channel with the log level at trace? With these I can better help figure out what might be going wrong. Thanks

Hey, thanks for your answer. Here are the logs:

Python Output ``` 2024-03-28 08:31:01.000 [info] Telemetry level is off 2024-03-28 08:31:01.000 [info] Experiments are disabled, only manually opted experiments are active. 2024-03-28 08:31:01.001 [debug] Getting roots 2024-03-28 08:31:01.001 [debug] Getting roots 2024-03-28 08:31:01.001 [debug] Found roots 2024-03-28 08:31:01.002 [debug] Start watching file for changes C:\Users\MalteB\.conda\environments.txt 2024-03-28 08:31:01.002 [debug] Start watching: C:\Users\MalteB\.conda with pattern environments.txt using VSCode API 2024-03-28 08:31:01.002 [debug] Found roots 2024-03-28 08:31:01.003 [debug] Start watching root d:\git\pytest_error for globs ["python.exe","*/python.exe","*/Scripts/python.exe"] 2024-03-28 08:31:01.003 [debug] Start watching: d:\git\pytest_error with pattern python.exe using VSCode API 2024-03-28 08:31:01.004 [debug] Start watching: d:\git\pytest_error with pattern */python.exe using VSCode API 2024-03-28 08:31:01.004 [debug] Start watching: d:\git\pytest_error with pattern */Scripts/python.exe using VSCode API 2024-03-28 08:31:01.051 [info] Default formatter is set to ms-python.black-formatter for workspace d:\git\pytest_error 2024-03-28 08:31:01.059 [debug] Waiting for test server to start... 2024-03-28 08:31:01.075 [info] Test server listening. 2024-03-28 08:31:01.075 [debug] Test server started. 2024-03-28 08:31:01.076 [debug] Testing: Setting up watcher for d:\git\pytest_error 2024-03-28 08:31:01.077 [debug] Needed to validate C:\Program Files\Python311\python.exe with latest info 2024-03-28 08:31:01.078 [info] Python interpreter path: C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.079 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.365 [debug] Terminal name '' identified as shell 'other' 2024-03-28 08:31:01.366 [debug] Terminal shell path 'C:\Program Files\PowerShell\7\pwsh.exe' identified as shell 'powershellCore' 2024-03-28 08:31:01.366 [debug] Shell identified as powershellCore (Terminal name is ) 2024-03-28 08:31:01.381 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.382 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.383 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.387 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.387 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.389 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.393 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.393 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.394 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.397 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.397 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.399 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.406 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.406 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.419 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.419 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.571 [debug] Extension ms-python.black-formatter accessed onDidChangeActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.598 [debug] Extension ms-python.black-formatter accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.600 [debug] Extension ms-python.black-formatter accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.604 [debug] Extension ms-python.black-formatter accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.606 [debug] Extension ms-python.black-formatter accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.608 [debug] Extension ms-python.black-formatter accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.610 [debug] Extension ms-python.flake8 accessed onDidChangeActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.612 [debug] Extension ms-python.flake8 accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.614 [debug] Extension ms-python.flake8 accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.616 [debug] Extension ms-python.flake8 accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.619 [debug] Extension ms-python.flake8 accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.621 [debug] Extension ms-python.flake8 accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.623 [debug] Extension ms-python.black-formatter accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.625 [debug] Extension ms-python.flake8 accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.627 [debug] Extension ms-python.isort accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.629 [debug] Extension ms-python.isort accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.631 [debug] Extension ms-python.isort accessed onDidChangeActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.633 [debug] Extension ms-python.isort accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.635 [debug] Extension ms-python.isort accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.637 [debug] Extension ms-python.isort accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.639 [debug] Extension ms-python.isort accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.642 [debug] Extension ms-python.pylint accessed onDidChangeActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.644 [debug] Extension ms-python.pylint accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.646 [debug] Extension ms-python.pylint accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.648 [debug] Extension ms-python.pylint accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.651 [debug] Extension ms-python.pylint accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.653 [debug] Extension ms-python.pylint accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.656 [debug] Extension ms-python.pylint accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:01.767 [debug] Extension ms-python.vscode-pylance accessed onDidChangeActiveEnvironmentPath with args: undefined 2024-03-28 08:31:01.769 [debug] Extension ms-python.vscode-pylance accessed onDidEnvironmentVariablesChange with args: undefined 2024-03-28 08:31:01.865 [debug] Terminal name '' identified as shell 'other' 2024-03-28 08:31:01.866 [debug] Terminal shell path 'C:\Program Files\PowerShell\7\pwsh.exe' identified as shell 'powershellCore' 2024-03-28 08:31:01.867 [debug] Shell identified as powershellCore (Terminal name is ) 2024-03-28 08:31:01.868 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:01.869 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:02.280 [debug] PowerShell 7.4.1 Loading personal and system profiles took 757ms. D:\git\pytest_error ❯  & 'C:\Program Files\Python39\python.exe' 'c:\Users\MalteB\.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\libs\debug py\adapter/../..\debugpy\launcher' '56011' '--' 'c:\Users\MalteB\.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\testlauncher.py' 'd:\git\pytest_e rror' 'pytest' '--rootdir' 'd:\git\pytest_error' '--override-ini' 'junit_family=xunit1' '--junit-xml=C:\Users\MalteB\AppData\Local\Temp\tmp-24632zzJXToPkg4 FX.xml' '--capture' 'no' './test.py::test_multi' ============================= test session starts ============================= platform win32 -- Python 3.9.18, pytest-7.4.3, pluggy-1.3.0 rootdir: d:\git\pytest_error plugins: anyio-3.6.2 collected 1 item test.py. - generated xml file: C:\Users\MalteB\AppData\Local\Temp\tmp-24632zzJXToPkg4FX.xml - ============================== 1 passed in 7.79s ============================== D:\git\pytest_error ❯  *  History restored  PowerShell 7.4.1 Loading personal and system profiles took 1821ms. D:\git\pytest_error ❯  *  History restored  PowerShell 7.4.1 Loading personal and system profiles took 2312ms. D:\git\pytest_error ❯  *  History restored  PowerShell 7.4.1 Loading personal and system profiles took 1438ms. D:\git\pytest_error ❯  *  History restored   2024-03-28 08:31:02.281 [debug] PowerShell 7.4.1 ]0;C:\Program Files\PowerShell\7\pwsh.exe[?25h 2024-03-28 08:31:02.290 [debug]    ]0;C:\Program Files\PowerShell\7\pwsh.exe[?25h 2024-03-28 08:31:03.094 [debug] PowerShell 7.4.1 ]0;C:\Program Files\PowerShell\7\pwsh.exe[?25h 2024-03-28 08:31:03.095 [debug] PowerShell 7.4.1 2024-03-28 08:31:03.400 [debug] Clearing context for python dependencies not installed: d:\git\pytest_error\test.py 2024-03-28 08:31:03.794 [debug] Clearing context for python dependencies not installed: d:\git\pytest_error\test.py 2024-03-28 08:31:03.981 [info] Starting Pylance language server. 2024-03-28 08:31:03.983 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:03.984 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:03.986 [debug] Terminal shell path 'C:\Program Files\PowerShell\7\pwsh.exe' identified as shell 'powershellCore' 2024-03-28 08:31:03.987 [debug] Shell identified as powershellCore 2024-03-28 08:31:03.988 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:03.999 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:04.001 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:04.009 [debug] Extension ms-python.vscode-pylance accessed getEnvironmentVariables with args: undefined 2024-03-28 08:31:04.011 [debug] Extension ms-python.vscode-pylance accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:04.014 [debug] Extension ms-python.vscode-pylance accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:04.019 [debug] Extension ms-python.vscode-pylance accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:04.022 [debug] Extension ms-python.vscode-pylance accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:04.405 [debug] Loading personal and system profiles took 1628ms. 2024-03-28 08:31:04.552 [debug] Clearing context for python dependencies not installed: d:\git\pytest_error\test.py 2024-03-28 08:31:04.683 [debug] Loading personal and system profiles took 1521ms. 2024-03-28 08:31:04.937 [debug] Loading personal and system profiles took 1521ms. 2024-03-28 08:31:05.717 [debug] D:\git\pytest_error ❯ 2024-03-28 08:31:05.727 [debug]  2024-03-28 08:31:05.940 [debug] D:\git\pytest_error ❯ 2024-03-28 08:31:05.951 [debug]  2024-03-28 08:31:06.016 [debug] Clearing context for python dependencies not installed: d:\git\pytest_error\test.py 2024-03-28 08:31:06.220 [debug] D:\git\pytest_error ❯ 2024-03-28 08:31:06.227 [debug]  2024-03-28 08:31:11.687 [debug] Testing: Refreshing all test data 2024-03-28 08:31:11.687 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:11.689 [info] Discover tests for workspace name: pytest_error - uri: d:\git\pytest_error 2024-03-28 08:31:11.689 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:11.700 [debug] Activation Commands received undefined for shell cmd, resource d:\git\pytest_error and interpreter C:\Program Files\Python311\python.exe 2024-03-28 08:31:11.723 [info] > "C:\Program Files\Python311\python.exe" ~\.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\testing_tools\run_adapter.py discover pytest -- --rootdir . -s --cache-clear test.py 2024-03-28 08:31:11.723 [info] cwd: . 2024-03-28 08:31:12.226 [debug] Testing: Resolving item d:\git\pytest_error 2024-03-28 08:31:12.227 [debug] Testing: Resolving item d:\git\pytest_error\test.py 2024-03-28 08:31:17.384 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:17.388 [info] Using launch configuration in launch.json file. 2024-03-28 08:31:17.389 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:17.391 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:17.391 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:17.391 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:17.393 [debug] CreateEnv Trigger - turned off in settings 2024-03-28 08:31:17.555 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:17.557 [debug] Extension ms-python.debugpy accessed getActiveEnvironmentPath with args: undefined 2024-03-28 08:31:17.559 [debug] Extension ms-python.debugpy accessed resolveEnvironment with args: {"id":"C:\\PROGRAM FILES\\PYTHON311\\PYTHON.EXE","path":"C:\\Program Files\\Python311\\python.exe"} 2024-03-28 08:31:17.584 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:17.608 [debug] Extension ms-python.debugpy accessed resolveEnvironment with args: "C:\\Program Files\\Python311\\python.exe" 2024-03-28 08:31:18.151 [debug] Terminal name 'Python Debug Console' identified as shell 'other' 2024-03-28 08:31:18.152 [debug] Terminal shell path 'C:\Program Files\PowerShell\7\pwsh.exe' identified as shell 'powershellCore' 2024-03-28 08:31:18.152 [debug] Shell identified as powershellCore (Terminal name is Python Debug Console) 2024-03-28 08:31:18.152 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:18.153 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:18.273 [debug] Terminal name 'Python Debug Console' identified as shell 'other' 2024-03-28 08:31:18.273 [debug] Terminal shell path 'C:\Program Files\PowerShell\7\pwsh.exe' identified as shell 'powershellCore' 2024-03-28 08:31:18.273 [debug] Shell identified as powershellCore (Terminal name is Python Debug Console) 2024-03-28 08:31:18.274 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:18.274 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:18.664 [debug] PowerShell 7.4.1 ]0;C:\Program Files\PowerShell\7\pwsh.exe[?25h 2024-03-28 08:31:18.669 [debug] PowerShell 7.4.1           [?25h 2024-03-28 08:31:19.390 [info] Send text to terminal: & 'C:\Program Files\Python311\python.exe' 'c:\Users\MalteB\.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher' '60206' '--' 'c:\Users\MalteB\.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\testlauncher.py' 'd:\git\pytest_error' 'pytest' '--rootdir' 'd:\git\pytest_error' '--override-ini' 'junit_family=xunit1' '--junit-xml=C:\Users\MalteB\AppData\Local\Temp\tmp-266325cztoP3xb5X3.xml' '--capture' 'no' './test.py::test_multi' 2024-03-28 08:31:19.613 [debug] Loading personal and system profiles took 758ms. 2024-03-28 08:31:20.248 [debug] D:\git\pytest_error ❯ 2024-03-28 08:31:20.254 [debug]  2024-03-28 08:31:20.325 [debug] [?25l 2024-03-28 08:31:20.333 [debug]  D:\git\pytest_error ❯  & 'C:\Program Files\Python311\python.exe' 'c:\Users\MalteB\.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\lib s\debugpy\adapter/../..\debugpy\launcher' '60206' '--' 'c:\Users\MalteB\.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\testlauncher.py' 'd: \git\pytest_error' 'pytest' '--rootdir' 'd:\git\pytest_error' '--override-ini' 'junit_family=xunit1' '--junit-xml=C:\Users\MalteB\AppData\Local\Temp\ tmp-266325cztoP3xb5X3.xml' '--capture' 'no' './test.py::test_multi[?25h 2024-03-28 08:31:20.341 [debug] D:\git\pytest_error ❯  & 'C:\Program Files\Python311\python.exe' 'c:\Users\MalteB\.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\lib s\debugpy\adapter/../..\debugpy\launcher' '60206' '--' 'c:\Users\MalteB\.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\testlauncher.py' 'd: \git\pytest_error' 'pytest' '--rootdir' 'd:\git\pytest_error' '--override-ini' 'junit_family=xunit1' '--junit-xml=C:\Users\MalteB\AppData\Local\Temp\ tmp-266325cztoP3xb5X3.xml' '--capture' 'no' './test.py::test_multi'  [?25h 2024-03-28 08:31:22.324 [debug] ============================= test session starts ============================= 2024-03-28 08:31:22.333 [debug] platform win32 -- Python 3.11.8, pytest-7.3.1, pluggy-1.0.0 rootdir: d:\git\pytest_error plugins: anyio-3.6.2 collected 1 item 2024-03-28 08:31:22.343 [debug] test.py 2024-03-28 08:31:27.918 [debug] . 2024-03-28 08:31:27.956 [debug] - generated xml file: C:\Users\MalteB\AppData\Local\Temp\tmp-266325cztoP3xb5X3.xml - ============================== 1 passed in 5.60s ============================== 2024-03-28 08:31:29.010 [debug] D:\git\pytest_error ❯ 2024-03-28 08:31:29.018 [debug]  2024-03-28 08:31:53.018 [debug] Clearing context for python dependencies not installed: ms-python.python.Python 2024-03-28 08:31:53.018 [debug] Found cached env for C:\Program Files\Python311\python.exe 2024-03-28 08:31:53.018 [debug] Found cached env for C:\Program Files\Python311\python.exe ```

Please let me know if you need more information.

eleanorjboyd commented 7 months ago

Hi! From your logs I see 2024-03-28 08:31:11.723 [info] > "C:\Program Files\Python311\python.exe" ~\.vscode\extensions\ms-python.python-2024.2.1\pythonFiles\testing_tools\run_adapter.py discover pytest -- --rootdir . -s --cache-clear test.py which is pointing towards our non-rewrite code. Could you try it in the rewrite and let me know if that fixes the problem:

To try it yourself, add this setting to your users settings.json: "python.experiments.optInto": ["pythonTestAdapter"].

You can confirm you have the rewrite enabled by setting "python.analysis.logLevel": "Trace", in your user settings then check for Experiment 'pythonTestAdapter' is active in your python logs.

Thanks

eleanorjboyd commented 5 months ago

Hello! I am closing this issue since we have not heard back on the above question, please comment with the requested information if you are still experiencing this problem and I can re-open it. Thanks