microsoft / vscode-python

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

Tests are not being discovered correctly - pytest #22643

Closed rodzun closed 1 month ago

rodzun commented 8 months ago

Type: Bug

Behaviour

Expected vs. Actual

Extension should discover all unit tests but it does not. In terminal it finds a lot more test cases that in the extension.

Steps to reproduce:

I think I found the pattern for this issue. When you have several classes inside a unit test file, the extension only discovers the last class tests.

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

``` No error shown ```

User Settings

``` languageServer: "Pylance" testing • pytestArgs: "" • pytestEnabled: true ```

Extension version: 2023.22.0 VS Code version: Code 1.85.0 (af28b32d7e553898b2a91af498b1fb666fdebe0c, 2023-12-06T20:48:09.019Z) OS version: Windows_NT x64 10.0.22621 Modes: Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-11390H @ 3.40GHz (8 x 2918)| |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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.74GB (7.88GB free)| |Process Argv|--crash-reporter-id 93887114-f95c-4ef0-96d1-9a3c94563709| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 5.15.133.1-microsoft-standard-WSL2| |CPUs|11th Gen Intel(R) Core(TM) i7-11390H @ 3.40GHz (8 x 2918)| |Memory (System)|15.50GB (11.61GB free)| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 pythonvs932:30410667 py29gd2263:30899288 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 azure-dev_surveyonecf:30548226 2e4cg342:30602488 89544117:30613380 showlangstatbar:30737416 962ge761:30917236 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 welcomedialog:30910333 pythonnosmt12:30797651 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixt:30902429 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 aa_t_chat:30882232 ```
rodzun commented 8 months ago

As a side note, it also shows two test trees (as shown in the ss) when it should only show the last one. The first has nothing inside and if I run that one it runs indefinitely. It does not change the main behavior but may be related to the issue.

image

eleanorjboyd commented 8 months ago

Hello! Could you include a layout of your project and your logs from the python output channel? For your logs, can you first set your log level to trace via theDeveloper: set log level command in the command palette? With these I can better help figure out what might be going wrong. Thanks

rodzun commented 8 months ago
Python Output 2023-12-14 02:00:38.406 [info] Experiment 'pythonRecommendTensorboardExt' is active 2023-12-14 02:00:38.406 [info] Experiment 'pythonREPLSmartSend' is active 2023-12-14 02:00:38.406 [info] Experiment 'pythonTerminalEnvVarActivation' is active 2023-12-14 02:00:38.406 [info] Experiment 'pythonTestAdapter' is active 2023-12-14 02:00:38.406 [debug] Getting roots 2023-12-14 02:00:38.406 [debug] Getting roots 2023-12-14 02:00:38.406 [debug] Found roots 2023-12-14 02:00:38.406 [debug] Start watching file for changes /home/rodzun/.conda/environments.txt 2023-12-14 02:00:38.406 [debug] Start watching: /home/rodzun/.conda with pattern environments.txt using VSCode API 2023-12-14 02:00:38.406 [debug] Found roots 2023-12-14 02:00:38.406 [debug] Start watching root /home/rodzun/reviNEW/z-dash for globs ["python","*/python","*/bin/python"] 2023-12-14 02:00:38.406 [debug] Start watching: /home/rodzun/reviNEW/z-dash with pattern python using VSCode API 2023-12-14 02:00:38.406 [debug] Start watching: /home/rodzun/reviNEW/z-dash with pattern */python using VSCode API 2023-12-14 02:00:38.406 [debug] Start watching: /home/rodzun/reviNEW/z-dash with pattern */bin/python using VSCode API 2023-12-14 02:00:38.406 [info] Default formatter is set to null for workspace /home/rodzun/reviNEW/z-dash 2023-12-14 02:00:38.406 [debug] Waiting for test server to start... 2023-12-14 02:00:38.408 [info] Test server listening. 2023-12-14 02:00:38.408 [debug] Test server started. 2023-12-14 02:00:38.408 [debug] Testing: Setting up watcher for /home/rodzun/reviNEW/z-dash 2023-12-14 02:00:38.409 [debug] Needed to validate /home/rodzun/.virtualenvs/revi310/bin/python with latest info 2023-12-14 02:00:38.412 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:38.413 [debug] Needed to validate /home/rodzun/.virtualenvs/turn/bin/python with latest info 2023-12-14 02:00:38.414 [debug] Needed to validate /home/rodzun/.virtualenvs/cuboid-challenge-python-emhoVg_9/bin/python with latest info 2023-12-14 02:00:38.414 [debug] Needed to validate /home/rodzun/.virtualenvs/fullstacklabs/bin/python with latest info 2023-12-14 02:00:38.415 [debug] Needed to validate /home/rodzun/.virtualenvs/koombea/bin/python with latest info 2023-12-14 02:00:38.416 [debug] Needed to validate /home/rodzun/.virtualenvs/revi/bin/python with latest info 2023-12-14 02:00:38.417 [debug] Needed to validate /bin/python2 with latest info 2023-12-14 02:00:38.418 [debug] Needed to validate /bin/python3 with latest info 2023-12-14 02:00:38.419 [debug] Needed to validate /bin/python3.7 with latest info 2023-12-14 02:00:38.419 [debug] Needed to validate /bin/python3.9 with latest info 2023-12-14 02:00:38.420 [debug] Needed to validate /usr/bin/python2 with latest info 2023-12-14 02:00:38.423 [debug] Needed to validate /usr/bin/python3 with latest info 2023-12-14 02:00:38.424 [debug] Needed to validate /usr/bin/python3.7 with latest info 2023-12-14 02:00:38.424 [debug] Needed to validate /usr/bin/python3.9 with latest info 2023-12-14 02:00:38.425 [debug] Needed to validate /home/rodzun/.virtualenvs/revi310/bin/python with latest info 2023-12-14 02:00:38.425 [debug] Needed to validate /bin/python3.10 with latest info 2023-12-14 02:00:38.425 [debug] Needed to validate /usr/bin/python3.10 with latest info 2023-12-14 02:00:38.427 [debug] Needed to validate /home/rodzun/.virtualenvs/revi310/bin/python with latest info 2023-12-14 02:00:38.428 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:38.429 [debug] Needed to validate /home/rodzun/.virtualenvs/revi310/bin/python with latest info 2023-12-14 02:00:38.430 [info] Python interpreter path: ~/.virtualenvs/revi310/bin/python 2023-12-14 02:00:38.430 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:38.919 [info] Send text to terminal: echo /usr/bin/bash 2023-12-14 02:00:38.920 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:38.928 [debug] Extension ms-toolsai.jupyter accessed onDidEnvironmentVariablesChange with args: undefined 2023-12-14 02:00:38.929 [debug] Extension ms-toolsai.jupyter accessed onDidChangeEnvironments with args: undefined 2023-12-14 02:00:38.931 [debug] Extension ms-toolsai.jupyter accessed getEnvironmentVariables with args: undefined 2023-12-14 02:00:38.932 [debug] Extension ms-toolsai.jupyter accessed onDidChangeEnvironments with args: undefined 2023-12-14 02:00:38.933 [debug] Extension ms-toolsai.jupyter accessed known with args: undefined 2023-12-14 02:00:38.934 [debug] Extension ms-toolsai.jupyter accessed onDidEnvironmentVariablesChange with args: undefined 2023-12-14 02:00:38.935 [debug] Extension ms-toolsai.jupyter accessed onDidChangeActiveEnvironmentPath with args: undefined 2023-12-14 02:00:38.936 [debug] Extension ms-toolsai.jupyter accessed onDidChangeEnvironments with args: undefined 2023-12-14 02:00:38.937 [debug] Extension ms-toolsai.jupyter accessed getActiveEnvironmentPath with args: undefined 2023-12-14 02:00:38.938 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"id":"/home/rodzun/.virtualenvs/revi310/bin/python","path":"/home/rodzun/.virtualenvs/revi310/bin/python"} 2023-12-14 02:00:38.940 [debug] Extension ms-toolsai.jupyter accessed known with args: undefined 2023-12-14 02:00:38.941 [debug] Extension ms-toolsai.jupyter accessed known with args: undefined 2023-12-14 02:00:38.942 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/home/rodzun/.virtualenvs/turn/bin/python","id":"/home/rodzun/.virtualenvs/turn/bin/python","executable":{"uri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/turn/bin/python","scheme":"file"},"bitness":"64-bit","sysPrefix":"/home/rodzun/.virtualenvs/turn"},"environment":{"type":"VirtualEnvironment","name":"turn","folderUri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/turn","scheme":"file"}},"version":{"major":3,"minor":8,"micro":10,"release":{"level":"final","serial":0},"sysVersion":"3.8.10 (default, May 26 2023, 14:05:08) \n[GCC 9.4.0]"},"tools":["Venv"]},"id":"/home/rodzun/.virtualenvs/turn/bin/python"} 2023-12-14 02:00:38.942 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/home/rodzun/.virtualenvs/cuboid-challenge-python-emhoVg_9/bin/python","id":"/home/rodzun/.virtualenvs/cuboid-challenge-python-emhoVg_9/bin/python","executable":{"uri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/cuboid-challenge-python-emhoVg_9/bin/python","scheme":"file"},"bitness":"64-bit","sysPrefix":"/home/rodzun/.virtualenvs/cuboid-challenge-python-emhoVg_9"},"environment":{"type":"VirtualEnvironment","name":"cuboid-challenge-python-emhoVg_9","folderUri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/cuboid-challenge-python-emhoVg_9","scheme":"file"}},"version":{"major":3,"minor":9,"micro":17,"release":{"level":"final","serial":0},"sysVersion":"3.9.17 (main, Jun 6 2023, 20:11:04) \n[GCC 9.4.0]"},"tools":["Pipenv"]},"id":"/home/rodzun/.virtualenvs/cuboid-challenge-python-emhoVg_9/bin/python"} 2023-12-14 02:00:38.943 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/home/rodzun/.virtualenvs/fullstacklabs/bin/python","id":"/home/rodzun/.virtualenvs/fullstacklabs/bin/python","executable":{"uri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/fullstacklabs/bin/python","scheme":"file"},"bitness":"64-bit","sysPrefix":"/home/rodzun/.virtualenvs/fullstacklabs"},"environment":{"type":"VirtualEnvironment","name":"fullstacklabs","folderUri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/fullstacklabs","scheme":"file"}},"version":{"major":3,"minor":8,"micro":10,"release":{"level":"final","serial":0},"sysVersion":"3.8.10 (default, May 26 2023, 14:05:08) \n[GCC 9.4.0]"},"tools":["Venv"]},"id":"/home/rodzun/.virtualenvs/fullstacklabs/bin/python"} 2023-12-14 02:00:38.944 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/home/rodzun/.virtualenvs/koombea/bin/python","id":"/home/rodzun/.virtualenvs/koombea/bin/python","executable":{"uri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/koombea/bin/python","scheme":"file"},"bitness":"64-bit","sysPrefix":"/home/rodzun/.virtualenvs/koombea"},"environment":{"type":"VirtualEnvironment","name":"koombea","folderUri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/koombea","scheme":"file"}},"version":{"major":3,"minor":8,"micro":10,"release":{"level":"final","serial":0},"sysVersion":"3.8.10 (default, May 26 2023, 14:05:08) \n[GCC 9.4.0]"},"tools":["Venv"]},"id":"/home/rodzun/.virtualenvs/koombea/bin/python"} 2023-12-14 02:00:38.945 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/home/rodzun/.virtualenvs/revi/bin/python","id":"/home/rodzun/.virtualenvs/revi/bin/python","executable":{"uri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/revi/bin/python","scheme":"file"},"bitness":"64-bit","sysPrefix":"/home/rodzun/.virtualenvs/revi"},"environment":{"type":"VirtualEnvironment","name":"revi","folderUri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/revi","scheme":"file"}},"version":{"major":3,"minor":7,"micro":17,"release":{"level":"final","serial":0},"sysVersion":"3.7.17 (default, Jun 6 2023, 20:10:10) \n[GCC 9.4.0]"},"tools":["Venv"]},"id":"/home/rodzun/.virtualenvs/revi/bin/python"} 2023-12-14 02:00:38.946 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/bin/python2","id":"/bin/python2","executable":{"uri":{"$mid":1,"path":"/bin/python2","scheme":"file"},"bitness":"64-bit","sysPrefix":"/usr"},"version":{"major":2,"minor":7,"micro":18,"release":{"level":"final","serial":0},"sysVersion":"2.7.18 (default, Jul 1 2022, 12:27:04) \n[GCC 9.4.0]"},"tools":[]},"id":"/bin/python2"} 2023-12-14 02:00:38.948 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/bin/python3","id":"/bin/python3","executable":{"uri":{"$mid":1,"path":"/bin/python3","scheme":"file"},"bitness":"64-bit","sysPrefix":"/usr"},"version":{"major":3,"minor":8,"micro":10,"release":{"level":"final","serial":0},"sysVersion":"3.8.10 (default, May 26 2023, 14:05:08) \n[GCC 9.4.0]"},"tools":[]},"id":"/bin/python3"} 2023-12-14 02:00:38.949 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/bin/python3.7","id":"/bin/python3.7","executable":{"uri":{"$mid":1,"path":"/bin/python3.7","scheme":"file"},"bitness":"64-bit","sysPrefix":"/usr"},"version":{"major":3,"minor":7,"micro":17,"release":{"level":"final","serial":0},"sysVersion":"3.7.17 (default, Jun 6 2023, 20:10:10) \n[GCC 9.4.0]"},"tools":[]},"id":"/bin/python3.7"} 2023-12-14 02:00:38.950 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/bin/python3.9","id":"/bin/python3.9","executable":{"uri":{"$mid":1,"path":"/bin/python3.9","scheme":"file"},"bitness":"64-bit","sysPrefix":"/usr"},"version":{"major":3,"minor":9,"micro":17,"release":{"level":"final","serial":0},"sysVersion":"3.9.17 (main, Jun 6 2023, 20:11:04) \n[GCC 9.4.0]"},"tools":[]},"id":"/bin/python3.9"} 2023-12-14 02:00:38.951 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/usr/bin/python2","id":"/usr/bin/python2","executable":{"uri":{"$mid":1,"path":"/usr/bin/python2","scheme":"file"},"bitness":"64-bit","sysPrefix":"/usr"},"version":{"major":2,"minor":7,"micro":18,"release":{"level":"final","serial":0},"sysVersion":"2.7.18 (default, Jul 1 2022, 12:27:04) \n[GCC 9.4.0]"},"tools":[]},"id":"/usr/bin/python2"} 2023-12-14 02:00:38.952 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/usr/bin/python3","id":"/usr/bin/python3","executable":{"uri":{"$mid":1,"path":"/usr/bin/python3","scheme":"file"},"bitness":"64-bit","sysPrefix":"/usr"},"version":{"major":3,"minor":8,"micro":10,"release":{"level":"final","serial":0},"sysVersion":"3.8.10 (default, May 26 2023, 14:05:08) \n[GCC 9.4.0]"},"tools":[]},"id":"/usr/bin/python3"} 2023-12-14 02:00:38.953 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/usr/bin/python3.7","id":"/usr/bin/python3.7","executable":{"uri":{"$mid":1,"path":"/usr/bin/python3.7","scheme":"file"},"bitness":"64-bit","sysPrefix":"/usr"},"version":{"major":3,"minor":7,"micro":17,"release":{"level":"final","serial":0},"sysVersion":"3.7.17 (default, Jun 6 2023, 20:10:10) \n[GCC 9.4.0]"},"tools":[]},"id":"/usr/bin/python3.7"} 2023-12-14 02:00:38.954 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/usr/bin/python3.9","id":"/usr/bin/python3.9","executable":{"uri":{"$mid":1,"path":"/usr/bin/python3.9","scheme":"file"},"bitness":"64-bit","sysPrefix":"/usr"},"version":{"major":3,"minor":9,"micro":17,"release":{"level":"final","serial":0},"sysVersion":"3.9.17 (main, Jun 6 2023, 20:11:04) \n[GCC 9.4.0]"},"tools":[]},"id":"/usr/bin/python3.9"} 2023-12-14 02:00:38.956 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/home/rodzun/.virtualenvs/revi310/bin/python","id":"/home/rodzun/.virtualenvs/revi310/bin/python","executable":{"uri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/revi310/bin/python","scheme":"file"},"bitness":"64-bit","sysPrefix":"/home/rodzun/.virtualenvs/revi310"},"environment":{"type":"VirtualEnvironment","name":"revi310","folderUri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/revi310","scheme":"file"}},"version":{"major":3,"minor":10,"micro":12,"release":{"level":"final","serial":0},"sysVersion":"3.10.12 (main, Jun 7 2023, 12:45:35) [GCC 9.4.0]"},"tools":["Venv"]},"id":"/home/rodzun/.virtualenvs/revi310/bin/python"} 2023-12-14 02:00:38.972 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/bin/python3.10","id":"/bin/python3.10","executable":{"uri":{"$mid":1,"path":"/bin/python3.10","scheme":"file"},"bitness":"64-bit","sysPrefix":"/usr"},"version":{"major":3,"minor":10,"micro":12,"release":{"level":"final","serial":0},"sysVersion":"3.10.12 (main, Jun 7 2023, 12:45:35) [GCC 9.4.0]"},"tools":[]},"id":"/bin/python3.10"} 2023-12-14 02:00:38.974 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/usr/bin/python3.10","id":"/usr/bin/python3.10","executable":{"uri":{"$mid":1,"path":"/usr/bin/python3.10","scheme":"file"},"bitness":"64-bit","sysPrefix":"/usr"},"version":{"major":3,"minor":10,"micro":12,"release":{"level":"final","serial":0},"sysVersion":"3.10.12 (main, Jun 7 2023, 12:45:35) [GCC 9.4.0]"},"tools":[]},"id":"/usr/bin/python3.10"} 2023-12-14 02:00:38.975 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"id":"/home/rodzun/.virtualenvs/revi310/bin/python","path":"/home/rodzun/.virtualenvs/revi310/bin/python"} 2023-12-14 02:00:38.976 [debug] Extension ms-toolsai.jupyter accessed getActiveEnvironmentPath with args: undefined 2023-12-14 02:00:38.985 [debug] Extension ms-toolsai.jupyter accessed getActiveEnvironmentPath with args: undefined 2023-12-14 02:00:38.986 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"id":"/home/rodzun/.virtualenvs/revi310/bin/python","path":"/home/rodzun/.virtualenvs/revi310/bin/python"} 2023-12-14 02:00:38.988 [debug] Extension ms-toolsai.jupyter accessed known with args: undefined 2023-12-14 02:00:38.989 [debug] Extension ms-toolsai.jupyter accessed known with args: undefined 2023-12-14 02:00:38.991 [debug] Extension ms-toolsai.jupyter accessed resolveEnvironment with args: {"internal":{"path":"/home/rodzun/.virtualenvs/revi310/bin/python","id":"/home/rodzun/.virtualenvs/revi310/bin/python","executable":{"uri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/revi310/bin/python","scheme":"file"},"bitness":"64-bit","sysPrefix":"/home/rodzun/.virtualenvs/revi310"},"environment":{"type":"VirtualEnvironment","name":"revi310","folderUri":{"$mid":1,"path":"/home/rodzun/.virtualenvs/revi310","scheme":"file"}},"version":{"major":3,"minor":10,"micro":12,"release":{"level":"final","serial":0},"sysVersion":"3.10.12 (main, Jun 7 2023, 12:45:35) [GCC 9.4.0]"},"tools":["Venv"]},"id":"/home/rodzun/.virtualenvs/revi310/bin/python"} 2023-12-14 02:00:39.012 [debug] Searching for conda. 2023-12-14 02:00:39.028 [debug] Probing conda binary: conda 2023-12-14 02:00:39.084 [debug] Extension ms-toolsai.jupyter accessed getEnvironmentVariables with args: undefined 2023-12-14 02:00:39.129 [debug] Dump environment variables { "USER": "rodzun", "VSCODE_WSL_EXT_LOCATION": "/mnt/c/Users/RodZun/.vscode/extensions/ms-vscode-remote.remote-wsl-0.81.8", "SHLVL": "0", "HOME": "/home/rodzun", "WSL_DISTRO_NAME": "Ubuntu", "WAYLAND_DISPLAY": "wayland-0", "LOGNAME": "rodzun", "NAME": "DESKTOP-NTQQJMV", "WSL_INTEROP": "/run/WSL/12_interop", "PULSE_SERVER": "unix:/mnt/wslg/PulseServer", "_": "/home/rodzun/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666fdebe0c/node", "TERM": "xterm-256color", "XDG_RUNTIME_DIR": "/mnt/wslg/runtime-dir", "DISPLAY": ":0", "LANG": "C.UTF-8", "SHELL": "/bin/bash", "PWD": "/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code", "WSL2_GUI_APPS_ENABLED": "1", "HOSTTYPE": "x86_64", "WSLENV": "VSCODE_WSL_EXT_LOCATION/up", "VSCODE_HANDLES_SIGPIPE": "true", "VIRTUALENVWRAPPER_SCRIPT": "/usr/local/bin/virtualenvwrapper.sh", "VIRTUALENVWRAPPER_WORKON_CD": "1", "WORKON_HOME": "/home/rodzun/.virtualenvs", "VIRTUALENVWRAPPER_PROJECT_FILENAME": ".project", "XDG_DATA_DIRS": "/usr/local/share:/usr/share:/var/lib/snapd/desktop", "VIRTUALENVWRAPPER_HOOK_DIR": "/home/rodzun/.virtualenvs", "VSCODE_AMD_ENTRYPOINT": "vs/workbench/api/node/extensionHostProcess", "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true", "VSCODE_NLS_CONFIG": "{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}", "VSCODE_CWD": "/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code", "ELECTRON_RUN_AS_NODE": "1", "VSCODE_IPC_HOOK_CLI": "/mnt/wslg/runtime-dir/vscode-ipc-55aff914-b383-4cc4-b873-d17618b497ea.sock", "PATH": "/home/rodzun/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666fdebe0c/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/RodZun/AppData/Roaming/nvm:/mnt/c/Program Files/nodejs:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Users/RodZun/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/heroku/bin:/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/RodZun/AppData/Roaming/npm:/mnt/c/Users/RodZun/AppData/Roaming/nvm:/mnt/c/Program Files/nodejs:/snap/bin" } 2023-12-14 02:00:39.133 [info] > conda info --json 2023-12-14 02:00:39.133 [debug] Worker id 1 for file plainExec.worker.js with data {"file":"conda","args":["info","--json"],"options":{"timeout":45000,"useWorker":true}} 2023-12-14 02:00:39.328 [debug] Extension ms-python.vscode-pylance accessed onDidChangeActiveEnvironmentPath with args: undefined 2023-12-14 02:00:39.330 [debug] Extension ms-python.vscode-pylance accessed onDidEnvironmentVariablesChange with args: undefined 2023-12-14 02:00:39.344 [debug] Activation Commands received source /home/rodzun/.virtualenvs/revi310/bin/activate for shell bash, resource /home/rodzun/reviNEW/z-dash and interpreter /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:39.344 [debug] Activating Environment to capture Environment variables, . /home/rodzun/.virtualenvs/revi310/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /home/rodzun/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles/printEnvVariables.py 2023-12-14 02:00:39.344 [info] > . ~/.virtualenvs/revi310/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles/printEnvVariables.py 2023-12-14 02:00:39.344 [info] shell: bash 2023-12-14 02:00:39.347 [debug] Failed to spawn conda binary conda Error: spawn conda ENOENT at ChildProcess._handle.onexit (node:internal/child_process:283:19) at onErrorNT (node:internal/child_process:476:16) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) 2023-12-14 02:00:39.399 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:39.490 [debug] Couldn't locate the conda binary. 2023-12-14 02:00:39.562 [debug] Activation Commands received source /home/rodzun/.virtualenvs/revi310/bin/activate for shell /usr/bin/bash, resource /home/rodzun/reviNEW/z-dash and interpreter /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:39.562 [debug] Activating Environment to capture Environment variables, . /home/rodzun/.virtualenvs/revi310/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python /home/rodzun/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles/printEnvVariables.py 2023-12-14 02:00:39.562 [info] > . ~/.virtualenvs/revi310/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles/printEnvVariables.py 2023-12-14 02:00:39.562 [info] shell: bash 2023-12-14 02:00:39.652 [debug] Activated environment variables for /home/rodzun/reviNEW/z-dash { SHELL: '/bin/bash', PYTHONUNBUFFERED: '1', WSL2_GUI_APPS_ENABLED: '1', WSL_DISTRO_NAME: 'Ubuntu', ELECTRON_RUN_AS_NODE: '1', VSCODE_AMD_ENTRYPOINT: 'vs/workbench/api/node/extensionHostProcess', NAME: 'DESKTOP-NTQQJMV', PWD: '/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code', LOGNAME: 'rodzun', VIRTUALENVWRAPPER_SCRIPT: '/usr/local/bin/virtualenvwrapper.sh', HOME: '/home/rodzun', LANG: 'C.UTF-8', WSL_INTEROP: '/run/WSL/12_interop', VIRTUAL_ENV: '/home/rodzun/.virtualenvs/revi310', WAYLAND_DISPLAY: 'wayland-0', VIRTUALENVWRAPPER_WORKON_CD: '1', WORKON_HOME: '/home/rodzun/.virtualenvs', VSCODE_HANDLES_SIGPIPE: 'true', TERM: 'xterm-256color', USER: 'rodzun', PYTHONIOENCODING: 'utf-8', VIRTUALENVWRAPPER_PROJECT_FILENAME: '.project', DISPLAY: ':0', SHLVL: '0', VSCODE_CWD: '/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code', XDG_RUNTIME_DIR: '/mnt/wslg/runtime-dir', PS1: '(revi310) ', WSLENV: 'VSCODE_WSL_EXT_LOCATION/up', VSCODE_WSL_EXT_LOCATION: '/mnt/c/Users/RodZun/.vscode/extensions/ms-vscode-remote.remote-wsl-0.81.8', XDG_DATA_DIRS: '/usr/local/share:/usr/share:/var/lib/snapd/desktop', PATH: '/home/rodzun/.virtualenvs/revi310/bin:/home/rodzun/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666fdebe0c/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/RodZun/AppData/Roaming/nvm:/mnt/c/Program Files/nodejs:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Users/RodZun/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/heroku/bin:/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/RodZun/AppData/Roaming/npm:/mnt/c/Users/RodZun/AppData/Roaming/nvm:/mnt/c/Program Files/nodejs:/snap/bin', VIRTUALENVWRAPPER_HOOK_DIR: '/home/rodzun/.virtualenvs', VSCODE_NLS_CONFIG: '{"locale":"en","osLocale":"en","availableLanguages":{}}', HOSTTYPE: 'x86_64', PULSE_SERVER: 'unix:/mnt/wslg/PulseServer', VSCODE_HANDLES_UNCAUGHT_ERRORS: 'true', VSCODE_IPC_HOOK_CLI: '/mnt/wslg/runtime-dir/vscode-ipc-55aff914-b383-4cc4-b873-d17618b497ea.sock', _: '/home/rodzun/.virtualenvs/revi310/bin/python' } 2023-12-14 02:00:39.664 [info] > /bin/python2 ~/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles/printEnvVariables.py 2023-12-14 02:00:39.664 [info] shell: bash 2023-12-14 02:00:39.682 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:39.682 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:39.684 [debug] Setting environment variable VIRTUAL_ENV in collection to /home/rodzun/.virtualenvs/revi310 2023-12-14 02:00:39.684 [debug] Prepending environment variable PS1 in collection with (revi310) 2023-12-14 02:00:39.684 [debug] Prepending environment variable PATH in collection with /home/rodzun/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles/deactivate/bash:/home/rodzun/.virtualenvs/revi310/bin: 2023-12-14 02:00:39.685 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:39.686 [info] Send text to terminal: /bin/python2 /home/rodzun/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles/printEnvVariablesToFile.py /home/rodzun/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles/deactivate/bash/envVars.txt 2023-12-14 02:00:39.761 [debug] Clearing context for python dependencies not installed: /home/rodzun/reviNEW/z-dash/zdash/revi/orders/api/endpoints/orders_viewset.py 2023-12-14 02:00:39.888 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:40.798 [info] Starting Pylance language server. 2023-12-14 02:00:40.801 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:40.811 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:40.812 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:40.871 [debug] Extension ms-python.vscode-pylance accessed getActiveEnvironmentPath with args: undefined 2023-12-14 02:00:40.874 [debug] Extension ms-python.vscode-pylance accessed resolveEnvironment with args: {"id":"/home/rodzun/.virtualenvs/revi310/bin/python","path":"/home/rodzun/.virtualenvs/revi310/bin/python"} 2023-12-14 02:00:40.876 [debug] Extension ms-python.vscode-pylance accessed getEnvironmentVariables with args: undefined 2023-12-14 02:00:40.878 [debug] Extension ms-python.vscode-pylance accessed getActiveEnvironmentPath with args: undefined 2023-12-14 02:00:40.880 [debug] Extension ms-python.vscode-pylance accessed resolveEnvironment with args: {"id":"/home/rodzun/.virtualenvs/revi310/bin/python","path":"/home/rodzun/.virtualenvs/revi310/bin/python"} 2023-12-14 02:00:43.101 [debug] Testing: Refreshing all test data 2023-12-14 02:00:43.101 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:43.109 [info] Discover tests for workspace name: z-dash - uri: /home/rodzun/reviNEW/z-dash 2023-12-14 02:00:43.109 [info] Running discovery for pytest using the new test adapter. 2023-12-14 02:00:43.110 [info] All environment variables set for pytest discovery for workspace /home/rodzun/reviNEW/z-dash: {"USER":"rodzun","VSCODE_WSL_EXT_LOCATION":"/mnt/c/Users/RodZun/.vscode/extensions/ms-vscode-remote.remote-wsl-0.81.8","SHLVL":"0","HOME":"/home/rodzun","WSL_DISTRO_NAME":"Ubuntu","WAYLAND_DISPLAY":"wayland-0","LOGNAME":"rodzun","NAME":"DESKTOP-NTQQJMV","WSL_INTEROP":"/run/WSL/12_interop","PULSE_SERVER":"unix:/mnt/wslg/PulseServer","_":"/home/rodzun/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666fdebe0c/node","TERM":"xterm-256color","XDG_RUNTIME_DIR":"/mnt/wslg/runtime-dir","DISPLAY":":0","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code","WSL2_GUI_APPS_ENABLED":"1","HOSTTYPE":"x86_64","WSLENV":"VSCODE_WSL_EXT_LOCATION/up","VSCODE_HANDLES_SIGPIPE":"true","VIRTUALENVWRAPPER_SCRIPT":"/usr/local/bin/virtualenvwrapper.sh","VIRTUALENVWRAPPER_WORKON_CD":"1","WORKON_HOME":"/home/rodzun/.virtualenvs","VIRTUALENVWRAPPER_PROJECT_FILENAME":".project","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","VIRTUALENVWRAPPER_HOOK_DIR":"/home/rodzun/.virtualenvs","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","VSCODE_CWD":"/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/mnt/wslg/runtime-dir/vscode-ipc-55aff914-b383-4cc4-b873-d17618b497ea.sock","PATH":"/home/rodzun/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666fdebe0c/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/RodZun/AppData/Roaming/nvm:/mnt/c/Program Files/nodejs:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/Docker/Docker/resources/bin:/mnt/c/Users/RodZun/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/heroku/bin:/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/RodZun/AppData/Roaming/npm:/mnt/c/Users/RodZun/AppData/Roaming/nvm:/mnt/c/Program Files/nodejs:/snap/bin","PYTHONPATH":"/home/rodzun/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles","TEST_UUID":"a50f4546-d6ad-4385-83b6-53c46d13495f","TEST_PORT":"35081"} 2023-12-14 02:00:43.110 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:43.142 [debug] Running pytest discovery with command: -m pytest -p vscode_pytest --collect-only zdash for workspace /home/rodzun/reviNEW/z-dash. 2023-12-14 02:00:43.143 [info] > ~/.virtualenvs/revi310/bin/python -m pytest -p vscode_pytest --collect-only zdash 2023-12-14 02:00:43.143 [info] cwd: . 2023-12-14 02:00:43.933 [debug] Terminal shell path '/usr/bin/bash' identified as shell 'bash' 2023-12-14 02:00:43.933 [debug] Shell identified as bash 2023-12-14 02:00:43.933 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-14 02:00:47.483 [debug] Clearing context for python dependencies not installed: /home/rodzun/reviNEW/z-dash/zdash/revi/orders/api/endpoints/orders_viewset.py 2023-12-14 02:00:47.727 [debug] Clearing context for python dependencies not installed: /home/rodzun/reviNEW/z-dash/zdash/revi/orders/api/endpoints/orders_viewset.py 2023-12-14 02:00:49.820 [info] ============================= test session starts ============================== 2023-12-14 02:00:49.820 [info] platform linux -- Python 3.10.12, pytest-6.2.5, py-1.11.0, pluggy-1.2.0 2023-12-14 02:00:49.826 [info] django: settings: zdash.settings (from ini) rootdir: /home/rodzun/reviNEW/z-dash/zdash, configfile: pytest.ini plugins: forked-1.6.0, django-3.10.0, mock-3.11.1, xdist-2.5.0, factoryboy-2.1.0, Faker-19.3.1, requests-mock-1.8.0, datadir-1.3.1, lazy-fixture-0.6.3 2023-12-14 02:00:58.380 [info] collected 2152 items 2023-12-14 02:00:58.380 [info] 2023-12-14 02:00:58.381 [info] 2023-12-14 02:00:58.381 [info] 2023-12-14 02:00:58.381 [info] 2023-12-14 02:00:58.381 [info] 2023-12-14 02:00:58.381 [info] 2023-12-14 02:00:58.381 [info] 2023-12-14 02:00:58.381 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.382 [info] 2023-12-14 02:00:58.383 [info] 2023-12-14 02:00:58.383 [info] 2023-12-14 02:00:58.383 [info] 2023-12-14 02:00:58.383 [info] 2023-12-14 02:00:58.383 [info] 2023-12-14 02:00:58.383 [info] 2023-12-14 02:00:58.384 [info] 2023-12-14 02:00:58.384 [info] 2023-12-14 02:00:58.384 [info] 2023-12-14 02:00:58.384 [info] 2023-12-14 02:00:58.384 [info] 2023-12-14 02:00:58.384 [info] 2023-12-14 02:00:58.384 [info] 2023-12-14 02:00:58.384 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] unavailable]> unavailable, but in DB item has -unavailable]> available]> available]> available, but has no -unavailable in DB]> unavailable]> unavailable]> 2023-12-14 02:00:58.385 [info] available]> available]> unavailable]> 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.385 [info] 2023-12-14 02:00:58.386 [info] 2023-12-14 02:00:58.386 [info] 2023-12-14 02:00:58.386 [info] 2023-12-14 02:00:58.387 [info] 2023-12-14 02:00:58.388 [info] $15 Subtotal]> 2023-12-14 02:00:58.388 [info] 2023-12-14 02:00:58.388 [info] 2023-12-14 02:00:58.388 [info] 2023-12-14 02:00:58.388 [info] 2023-12-14 02:00:58.388 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.389 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.390 [info] 2023-12-14 02:00:58.391 [info] 2023-12-14 02:00:58.391 [info] 2023-12-14 02:00:58.391 [info] 2023-12-14 02:00:58.391 [info] 2023-12-14 02:00:58.391 [info] 2023-12-14 02:00:58.391 [info] 2023-12-14 02:00:58.391 [info] 2023-12-14 02:00:58.391 [info] 2023-12-14 02:00:58.391 [info] 2023-12-14 02:00:58.391 [info] 2023-12-14 02:00:58.391 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.392 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.393 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.394 [info] 2023-12-14 02:00:58.395 [info] 2023-12-14 02:00:58.395 [info] 2023-12-14 02:00:58.395 [info] 2023-12-14 02:00:58.395 [info] 2023-12-14 02:00:58.395 [info] 2023-12-14 02:00:58.395 [info] 2023-12-14 02:00:58.395 [info] 2023-12-14 02:00:58.395 [info] 2023-12-14 02:00:58.395 [info] 2023-12-14 02:00:58.560 [info] Test server connected to a client. 2023-12-14 02:00:58.575 [debug] data received from python server: Content-Length: 1325927 Content-Type: application/json Request-uuid: a50f4546-d6ad-4385-83b6-53c46d13495f

In Terminal it shows 2152 tests:

======================== 2152 tests collected in 5.90s =========================

2023-12-14 01:45:16.636 [debug] deferredTill EOT resolved for /home/rodzun/reviNEW/z-dash
2023-12-14 01:45:16.636 [info] Disposing data receiver for /home/rodzun/reviNEW/z-dash and deleting UUID; pytest discovery.

In the extension 1352 tests: image

All apps have this folder structure: image

eleanorjboyd commented 8 months ago

Hello again, sorry for the back and forth. I looked through you logs and don't see anything which seems out of place. I explored your original comment where multiple test classes per file caused only the last test class to be found but was able to discover all 4 tests in this example. Does this example work for you? Is there a difference in setup between my example below and your multi-class setup?


# Example of a Python file with multiple classes and their corresponding tests using unittest

# Importing unittest module
import unittest

# First class to be tested
class Calculator:
    def add(self, a, b):
        return a + b

    def subtract(self, a, b):
        return a - b

# Second class to be tested
class StringManipulator:
    def capitalize(self, string):
        return string.capitalize()

    def reverse(self, string):
        return string[::-1]

# Test class for Calculator
class TestCalculator(unittest.TestCase):
    def test_add(self):
        calc = Calculator()
        self.assertEqual(calc.add(2, 3), 5)

    def test_subtract(self):
        calc = Calculator()
        self.assertEqual(calc.subtract(5, 3), 2)

# Test class for StringManipulator
class TestStringManipulator(unittest.TestCase):
    def test_capitalize(self):
        manipulator = StringManipulator()
        self.assertEqual(manipulator.capitalize("hello"), "Hello")

    def test_reverse(self):
        manipulator = StringManipulator()
        self.assertEqual(manipulator.reverse("hello"), "olleh")
rodzun commented 8 months ago

No worries, thank you for the tech support. Testing a little bit, I found out that the issue arises when using classes with pytest. It works fine with Unittest, it does not when "converting" to pytest. When doing so, the extension only finds tests from the last class. The bug is consistent with other colleagues as well.

# First class to be tested
class Calculator:
    def add(self, a, b):
        return a + b

    def subtract(self, a, b):
        return a - b

# Second class to be tested
class StringManipulator:
    def capitalize(self, string):
        return string.capitalize()

    def reverse(self, string):
        return string[::-1]

# Test functions for Calculator
class TestCalculator:
    def test_add(self):
        calc = Calculator()
        assert calc.add(2, 3) == 5

    def test_subtract(self):
        calc = Calculator()
        assert calc.subtract(5, 3) == 2

# Test functions for StringManipulator
class TestStringManipulator:
    def test_capitalize(self):
        manipulator = StringManipulator()
        assert manipulator.capitalize("hello") == "Hello"

    def test_reverse():
        manipulator = StringManipulator()
        assert manipulator.reverse("hello") == "olleh"

In this image you can see that only the last two tests are shown: image

eleanorjboyd commented 8 months ago

hm I am still seeing all them still be discovered with the code snippet you have above. Are you settings the same as mine? What type of machine are you on? Also if you set your logs to trace you should see a payload with all the test data, can you send over that / just your whole logs? Thanks

Screenshot 2023-12-14 at 4 09 20 PM Screenshot 2023-12-14 at 4 09 06 PM
rodzun commented 8 months ago

These are my settings:

{
    "python.testing.pytestArgs": [
        "zdash"
    ],
    "python.testing.unittestEnabled": false,
    "python.testing.pytestEnabled": true,
    "python.analysis.logLevel": "Trace"
}

My log is huge so I send you the related parts, let me know if you still need all the logs:

2023-12-15 15:11:37.300 [info] <Package api>
  <Module test_test.py>
    <Class TestCalculator>
        <Function test_add>
        <Function test_subtract>
    <Class TestStringManipulator>
2023-12-15 15:11:37.300 [info] 
        <Function test_capitalize>
        <Function test_reverse>
{"name": "test_test.py", "path": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py", "type_": "file", "id_": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py", "children": [{"name": "test_add", "path": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py", "lineno": "21", "type_": "test", "id_": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py::TestCalculator::test_add", "runID": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py::TestCalculator::test_add"}, {"name": "test_subtract", "path": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py", "lineno": "25", "type_": "test", "id_": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py::TestCalculator::test_subtract", "runID": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py::TestCalculator::test_subtract"}]}, {"name": "test_test.py", "path": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py", "type_": "file", "id_": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py", "children": [{"name": "test_capitalize", "path": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py", "lineno": "31", "type_": "test", "id_": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py::TestStringManipulator::test_capitalize", "runID": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py::TestStringManipulator::test_capitalize"}, {"name": "test_reverse", "path": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py", "lineno": "35", "type_": "test", "id_": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.py::TestStringManipulator::test_reverse", "runID": "/home/rodzun/reviNEW/z-dash/zdash/revi/personnel/tests/api/test_test.

All tests seems to be found in the logs, but they are not shown in the left tree panel, and certainly are not counted or tested there. image

I'm using Windows 11 with WSL2. VSCode 1.85.0

eleanorjboyd commented 8 months ago

Could you try my example project and see if it works for you here? Are any of my settings / design wrong here for your setup?

test_classes22643.zip

rodzun commented 8 months ago

Tested it and the issue persists. The logs seem to find all four tests but as you can see in the screenshot it only finds two in the panel in the left.

Python Output 2023-12-21 01:02:11.983 [debug] Testing: Refreshing all test data 2023-12-21 01:02:11.983 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-21 01:02:11.986 [info] Discover tests for workspace name: test_classes22643 - uri: /home/rodzun/test_classes22643 2023-12-21 01:02:11.986 [info] Running discovery for pytest using the new test adapter. 2023-12-21 01:02:11.986 [info] All environment variables set for pytest discovery for workspace /home/rodzun/test_classes22643: {"USER":"rodzun","VSCODE_WSL_EXT_LOCATION":"/mnt/c/Users/RodZun/.vscode/extensions/ms-vscode-remote.remote-wsl-0.81.8","SHLVL":"0","HOME":"/home/rodzun","WSL_DISTRO_NAME":"Ubuntu","WAYLAND_DISPLAY":"wayland-0","LOGNAME":"rodzun","NAME":"DESKTOP-NTQQJMV","WSL_INTEROP":"/run/WSL/13377_interop","PULSE_SERVER":"unix:/mnt/wslg/PulseServer","_":"/home/rodzun/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666fdebe0c/node","TERM":"xterm-256color","XDG_RUNTIME_DIR":"/mnt/wslg/runtime-dir","DISPLAY":":0","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code","WSL2_GUI_APPS_ENABLED":"1","HOSTTYPE":"x86_64","WSLENV":"VSCODE_WSL_EXT_LOCATION/up","VSCODE_HANDLES_SIGPIPE":"true","MOTD_SHOWN":"update-motd","VIRTUALENVWRAPPER_SCRIPT":"/usr/local/bin/virtualenvwrapper.sh","VIRTUALENVWRAPPER_WORKON_CD":"1","WORKON_HOME":"/home/rodzun/.virtualenvs","VIRTUALENVWRAPPER_PROJECT_FILENAME":".project","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","VIRTUALENVWRAPPER_HOOK_DIR":"/home/rodzun/.virtualenvs","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","VSCODE_CWD":"/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/mnt/wslg/runtime-dir/vscode-ipc-460424f2-8351-4e1c-92cd-7c0848e8c476.sock","PATH":"/home/rodzun/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666fdebe0c/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/RodZun/AppData/Roaming/nvm:/mnt/c/Program Files/nodejs:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/Docker/host/bin:/mnt/c/Users/RodZun/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/heroku/bin:/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/RodZun/AppData/Roaming/npm:/mnt/c/Users/RodZun/AppData/Roaming/nvm:/mnt/c/Program Files/nodejs:/snap/bin","PYTHONPATH":"/home/rodzun/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles","TEST_UUID":"1567efd3-d875-46b1-843d-de9d22cf7e08","TEST_PORT":"35407"} 2023-12-21 01:02:11.986 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-21 01:02:12.001 [debug] Running pytest discovery with command: -m pytest -p vscode_pytest --collect-only . for workspace /home/rodzun/test_classes22643. 2023-12-21 01:02:12.001 [info] > ~/.virtualenvs/revi310/bin/python -m pytest -p vscode_pytest --collect-only . 2023-12-21 01:02:12.001 [info] cwd: . 2023-12-21 01:02:12.411 [info] ============================= test session starts ============================== platform linux -- Python 3.10.12, pytest-6.2.5, py-1.11.0, pluggy-1.2.0 2023-12-21 01:02:12.417 [info] rootdir: /home/rodzun/test_classes22643 plugins: forked-1.6.0, django-3.10.0, mock-3.11.1, xdist-2.5.0, factoryboy-2.1.0, Faker-19.3.1, requests-mock-1.8.0, datadir-1.3.1, lazy-fixture-0.6.3 2023-12-21 01:02:12.422 [info] collected 4 items 2023-12-21 01:02:12.422 [info] 2023-12-21 01:02:12.424 [info] Test server connected to a client. 2023-12-21 01:02:12.424 [info] ========================== 4 tests collected in 0.01s ========================== 2023-12-21 01:02:12.429 [debug] data received from python server: Content-Length: 1028 Content-Type: application/json Request-uuid: 1567efd3-d875-46b1-843d-de9d22cf7e08 {"cwd": "/home/rodzun/test_classes22643", "status": "success", "tests": {"name": "test_classes22643", "path": "/home/rodzun/test_classes22643", "type_": "folder", "children": [{"name": "test_many_classes.py", "path": "/home/rodzun/test_classes22643/test_many_classes.py", "type_": "file", "id_": "/home/rodzun/test_classes22643/test_many_classes.py", "children": [{"name": "test_add", "path": "/home/rodzun/test_classes22643/test_many_classes.py", "lineno": "19", "type_": "test", "id_": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_add", "runID": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_add"}, {"name": "test_subtract", "path": "/home/rodzun/test_classes22643/test_many_classes.py", "lineno": "23", "type_": "test", "id_": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_subtract", "runID": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_subtract"}]}], "id_": "/home/rodzun/test_classes22643"}, "error": []}Content-Length: 42 Content-Type: application/json Request-uuid: 1567efd3-d875-46b1-843d-de9d22cf7e08 {"command_type": "discovery", "eot": true} 2023-12-21 01:02:12.429 [debug] Firing data received event, {"cwd": "/home/rodzun/test_classes22643", "status": "success", "tests": {"name": "test_classes22643", "path": "/home/rodzun/test_classes22643", "type_": "folder", "children": [{"name": "test_many_classes.py", "path": "/home/rodzun/test_classes22643/test_many_classes.py", "type_": "file", "id_": "/home/rodzun/test_classes22643/test_many_classes.py", "children": [{"name": "test_add", "path": "/home/rodzun/test_classes22643/test_many_classes.py", "lineno": "19", "type_": "test", "id_": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_add", "runID": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_add"}, {"name": "test_subtract", "path": "/home/rodzun/test_classes22643/test_many_classes.py", "lineno": "23", "type_": "test", "id_": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_subtract", "runID": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_subtract"}]}], "id_": "/home/rodzun/test_classes22643"}, "error": []} 2023-12-21 01:02:12.429 [debug] Firing data received event, {"command_type": "discovery", "eot": true} 2023-12-21 01:02:12.429 [info] ResultResolver EOT received for discovery. 2023-12-21 01:02:12.498 [debug] deferredTill EOT resolved for /home/rodzun/test_classes22643 2023-12-21 01:02:12.498 [info] Disposing data receiver for /home/rodzun/test_classes22643 and deleting UUID; pytest discovery. 2023-12-21 01:02:12.631 [debug] Testing: Resolving item /home/rodzun/test_classes22643 2023-12-21 01:02:12.631 [debug] Testing: Resolving item /home/rodzun/test_classes22643/test_many_classes.py 2023-12-21 01:02:27.806 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-21 01:02:27.809 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-21 01:02:27.823 [info] Server listening on port 33509 2023-12-21 01:02:27.823 [debug] Server started for pytest test ids server and listening on port 33509 2023-12-21 01:02:27.834 [info] All environment variables set for pytest execution in /home/rodzun/test_classes22643 workspace: {"USER":"rodzun","VSCODE_WSL_EXT_LOCATION":"/mnt/c/Users/RodZun/.vscode/extensions/ms-vscode-remote.remote-wsl-0.81.8","SHLVL":"0","HOME":"/home/rodzun","WSL_DISTRO_NAME":"Ubuntu","WAYLAND_DISPLAY":"wayland-0","LOGNAME":"rodzun","NAME":"DESKTOP-NTQQJMV","WSL_INTEROP":"/run/WSL/13377_interop","PULSE_SERVER":"unix:/mnt/wslg/PulseServer","_":"/home/rodzun/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666fdebe0c/node","TERM":"xterm-256color","XDG_RUNTIME_DIR":"/mnt/wslg/runtime-dir","DISPLAY":":0","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code","WSL2_GUI_APPS_ENABLED":"1","HOSTTYPE":"x86_64","WSLENV":"VSCODE_WSL_EXT_LOCATION/up","VSCODE_HANDLES_SIGPIPE":"true","MOTD_SHOWN":"update-motd","VIRTUALENVWRAPPER_SCRIPT":"/usr/local/bin/virtualenvwrapper.sh","VIRTUALENVWRAPPER_WORKON_CD":"1","WORKON_HOME":"/home/rodzun/.virtualenvs","VIRTUALENVWRAPPER_PROJECT_FILENAME":".project","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","VIRTUALENVWRAPPER_HOOK_DIR":"/home/rodzun/.virtualenvs","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","VSCODE_CWD":"/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/mnt/wslg/runtime-dir/vscode-ipc-460424f2-8351-4e1c-92cd-7c0848e8c476.sock","PATH":"/home/rodzun/.vscode-server/bin/af28b32d7e553898b2a91af498b1fb666fdebe0c/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/RodZun/AppData/Roaming/nvm:/mnt/c/Program Files/nodejs:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/Docker/host/bin:/mnt/c/Users/RodZun/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/heroku/bin:/mnt/c/Users/RodZun/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/RodZun/AppData/Roaming/npm:/mnt/c/Users/RodZun/AppData/Roaming/nvm:/mnt/c/Program Files/nodejs:/snap/bin","PYTHONPATH":"/home/rodzun/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles","TEST_UUID":"aefa4bca-24ed-4544-9e05-544755830dd9","TEST_PORT":"35407","RUN_TEST_IDS_PORT":"33509"} 2023-12-21 01:02:27.834 [info] Running pytest with arguments: /home/rodzun/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles/vscode_pytest/run_pytest_script.py --rootdir /home/rodzun/test_classes22643 for workspace /home/rodzun/test_classes22643 2023-12-21 01:02:27.834 [info] > ~/.virtualenvs/revi310/bin/python ~/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles/vscode_pytest/run_pytest_script.py --rootdir . 2023-12-21 01:02:27.834 [info] cwd: . 2023-12-21 01:02:28.360 [info] Test server connected to a client. 2023-12-21 01:02:28.362 [debug] data received from python server: Content-Length: 355 Content-Type: application/json Request-uuid: aefa4bca-24ed-4544-9e05-544755830dd9 {"cwd": "/home/rodzun/test_classes22643", "status": "success", "result": {"/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_add": {"test": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_add", "outcome": "success", "message": null, "traceback": null, "subtest": null}}, "not_found": null, "error": null} 2023-12-21 01:02:28.362 [debug] Firing data received event, {"cwd": "/home/rodzun/test_classes22643", "status": "success", "result": {"/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_add": {"test": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_add", "outcome": "success", "message": null, "traceback": null, "subtest": null}}, "not_found": null, "error": null} 2023-12-21 01:02:28.364 [debug] data received from python server: Content-Length: 365 Content-Type: application/json Request-uuid: aefa4bca-24ed-4544-9e05-544755830dd9 {"cwd": "/home/rodzun/test_classes22643", "status": "success", "result": {"/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_subtract": {"test": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_subtract", "outcome": "success", "message": null, "traceback": null, "subtest": null}}, "not_found": null, "error": null} 2023-12-21 01:02:28.364 [debug] Firing data received event, {"cwd": "/home/rodzun/test_classes22643", "status": "success", "result": {"/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_subtract": {"test": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_subtract", "outcome": "success", "message": null, "traceback": null, "subtest": null}}, "not_found": null, "error": null} 2023-12-21 01:02:28.366 [debug] data received from python server: Content-Length: 42 Content-Type: application/json Request-uuid: aefa4bca-24ed-4544-9e05-544755830dd9 {"command_type": "execution", "eot": true} 2023-12-21 01:02:28.366 [debug] Firing data received event, {"command_type": "execution", "eot": true} 2023-12-21 01:02:28.366 [info] ResultResolver EOT received for execution. 2023-12-21 01:02:28.386 [info] Client disconnected 2023-12-21 01:02:28.451 [debug] Test run finished, subprocess closed. 2023-12-21 01:02:28.451 [debug] deferredTill EOT resolved 2023-12-21 01:02:28.451 [info] Disposing data receiver for /home/rodzun/test_classes22643 and deleting UUID; pytest execution. 2023-12-21 01:02:32.020 [error] Failed to initialize deactivate script /usr/bin/bash [Error: "/home/rodzun/.vscode-server/extensions/ms-python.python-2023.22.1/pythonFiles/deactivate/bash/envVars.txt" file not created at Timeout. (/home/rodzun/.vscode-server/extensions/ms-python.python-2023.22.1/out/client/extension.js:2:280966) at listOnTimeout (node:internal/timers:569:17) at process.processTimers (node:internal/timers:512:7)] 2023-12-21 01:02:33.330 [debug] Clearing context for python dependencies not installed: ms-python.python.Python 2023-12-21 01:02:33.330 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-21 01:02:33.331 [debug] Found cached env for /home/rodzun/.virtualenvs/revi310/bin/python 2023-12-21 01:02:46.817 [debug] Worker id 1 exited with code 0

image

image

pnelson-bto commented 8 months ago

I'm also experiencing this same issue.

eleanorjboyd commented 8 months ago

@rodzun, I am not familiar with the "zdash" arg, what is that for?

@pnelson-bto Did you try the example project I sent? If so what settings or config are different?

Are you both on Windows to Linux using WSL? This could be the problem that is causing the bug

pnelson-bto commented 8 months ago

No, because I only use pytest. I even tried it 2 bare-boned pytest classes, which just asserted that 1 == 1. I am on Ubuntu. This issue seems to be relatively new. I recently performed the latest update on VSCode.

rodzun commented 8 months ago

Hi @eleanorjboyd , zdash is just the name of my project and a folder on top of it. I'm using WSL. Updated to last release and still having the issue.

eleanorjboyd commented 7 months ago

No, because I only use pytest. I even tried it 2 bare-boned pytest classes, which just asserted that 1 == 1. I am on Ubuntu. This issue seems to be relatively new. I recently performed the latest update on VSCode.

The repo should still work as pytest also discovers and executes unittest test cases. You coiuld also send over a minimal repro in your case if that would be easier. Thanks

eleanorjboyd commented 7 months ago

@rodzun, those logs were helpful, what I am seeing is that pytest sees 4 tests but the payload returned by the subprocess is only 2 (with the class TestCalculator also missing) so somewhere in building the test tree something is going wrong. I see from your logs you have a fair number of plugins, could you try without these and see if it makes a difference? plugins: forked-1.6.0, django-3.10.0, mock-3.11.1, xdist-2.5.0, factoryboy-2.1.0, Faker-19.3.1, requests-mock-1.8.0, datadir-1.3.1, lazy-fixture-0.6.3. If this doesn't work I can recreate your whole setup but the way your error is showing (with half the tests) it doesn't strike me as windows/wsl related. Thanks and let me know

This is your payload returned in a more understandable format

{
    "cwd": "/home/rodzun/test_classes22643",
    "status": "success",
    "tests": {
        "name": "test_classes22643",
        "path": "/home/rodzun/test_classes22643",
        "type_": "folder",
        "children": [
            {
                "name": "test_many_classes.py",
                "path": "/home/rodzun/test_classes22643/test_many_classes.py",
                "type_": "file",
                "id_": "/home/rodzun/test_classes22643/test_many_classes.py",
                "children": [
                    {
                        "name": "test_add",
                        "path": "/home/rodzun/test_classes22643/test_many_classes.py",
                        "lineno": "19",
                        "type_": "test",
                        "id_": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_add",
                        "runID": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_add"
                    },
                    {
                        "name": "test_subtract",
                        "path": "/home/rodzun/test_classes22643/test_many_classes.py",
                        "lineno": "23",
                        "type_": "test",
                        "id_": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_subtract",
                        "runID": "/home/rodzun/test_classes22643/test_many_classes.py::TestCalculator::test_subtract"
                    }
                ]
            }
        ],
        "id_": "/home/rodzun/test_classes22643"
    },
    "error": []
}
klevytskyi commented 6 months ago

I'm facing the same issue. I'm using pytest and tests from only the last class are shown in sidebar. However, in the Output tab all of them are listed correctly.

jevnikar commented 6 months ago

This problem has been plaguing me for months. My temporary solution has been to edit the VSCode state file to disable the "pythonTestAdapter" experimental feature.

Now that I've looked through this page and the one for issue #22457, it seems the easiest solution is to just update my pytest plugin from 6.2.x to the latest 8.x.x version - it immediately fixed the issue.

rodzun commented 6 months ago

My company updated pytest to 7.4.4 version and it's working correctly now

eleanorjboyd commented 5 months ago

Glad that worked! Our goal is to support all versions of pytest which that teams supports. Could you provide your specific pytest version which was causing the failure? We have added an old 6.2.x version to our CI to run and are not seeing this error as of now.

acmarco commented 4 months ago

Thanks for all the investigation, everyone. Upgrading to pytest@7.4.4 worked for me as well.

Tinuxx commented 4 months ago

My issue might be related. I have a project that uses pytest-lazy-fixture, and the test discovery broke recently after working fine for months. I am using pytest 7.4.4. and the v2024.5.11141012 (pre-release) Python extension. I have this minimum reproducible example:

import pytest
from pytest_lazyfixture import lazy_fixture

@pytest.fixture
def fixture_a():
    return "a"

@pytest.fixture
def fixture_b():
    return "b"

@pytest.fixture
def fixture_c():
    return "c"

class TestA:
    @pytest.fixture(
        scope="class",
        params=[lazy_fixture("fixture_a"), lazy_fixture("fixture_b")],
    )
    def fixt(self, request):
        return request.param

    def test_a(self, fixt):
        assert fixt in ["a", "b"]

class TestB:
    @pytest.fixture(
        scope="class",
        params=[lazy_fixture("fixture_a"), lazy_fixture("fixture_c")],
    )
    def fixt(self, request):
        return request.param

    def test_a(self, fixt):
        assert fixt in ["a", "c"]

The tests tree is incorrect: image

If I try to go to run/debug/go to test to the ones that are found twice, they all fall under the test that's declared first.

If I switch to the stable Python extension, the tests are discovered and run correctly:

image

eleanorjboyd commented 4 months ago

Hi @Tinuxx, I am able to repro this issue. I will work on putting in a fix. Thanks!

github-actions[bot] commented 2 months ago

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

Happy Coding!

mmaday commented 2 months ago

I'm also seeing this problem over here. Downgrading to v2024.4.1 of the Python extension is my current workaround. When looking through the debug logs, the newer broken extensions are not getting the ResultResolver EOT log messages.

Working on v2024.4.1:

======================== 8431 tests collected in 24.23s ========================

2024-06-18 23:41:26.450 [info] ResultResolver EOT received for discovery.
2024-06-18 23:41:26.450 [info] ResultResolver EOT received for discovery.
...
======================== 8431 tests collected in 24.44s ========================

2024-06-18 23:41:27.776 [info] ResultResolver EOT received for discovery.
2024-06-18 23:41:27.776 [info] ResultResolver EOT received for discovery.
2024-06-18 23:41:28.114 [info] Disposing data receiver for /home/vscode/workspace and deleting UUID; pytest discovery.
2024-06-18 23:41:28.165 [info] Disposing data receiver for /home/vscode/workspace and deleting UUID; pytest discovery.

Broken on v2024.4.1:

2024-06-18 23:30:37.108 [info] ======================== 8431 tests collected in 10.11s ========================

2024-06-18 23:30:37.109 [debug] client emitted close event, connectionCount:  0
2024-06-18 23:30:37.109 [debug] connection count is <= 0, closing the server:  /tmp/python-test-discovery-36c77d1b7d832c04556f.sock
2024-06-18 23:30:37.109 [debug] Test Discovery named pipe /tmp/python-test-discovery-36c77d1b7d832c04556f.sock closed
2024-06-18 23:30:37.109 [debug] Test Discovery named pipe /tmp/python-test-discovery-36c77d1b7d832c04556f.sock disposed
2024-06-18 23:30:38.912 [debug] deferredTill EOT resolved
2024-06-18 23:30:39.156 [debug] deferredTill EOT resolved
eleanorjboyd commented 2 months ago

Hi @mmaday, could you open a new issue with full repro steps? I am not sure if the problem you are facing is related

@Tinuxx, I am seeing the correct test explorer view now when I try to re-run the sample in the insiders extension- is it working for you?

Tinuxx commented 2 months ago

@eleanorjboyd I can confirm that the test discovery works and is displayed correctly after switching to pre-release:

image

Thanks! 😄

eleanorjboyd commented 2 months ago

Great! Thanks for verifying!

github-actions[bot] commented 1 month ago

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

Happy Coding!

eleanorjboyd commented 1 month ago

closing as complete- please comment if that is not the case