2023-06-22 16:38:50.133 [info] Discover tests for workspace name: TNLGv4-Inference - uri: /home/paulo/repos/TNLGv4-Inference
2023-06-22 16:38:50.133 [info] Running discovery for unittest using the new test adapter.
2023-06-22 16:38:50.142 [info] > conda run -n my_env --no-capture-output python ~/.vscode-server-insiders/extensions/ms-python.python-2023.11.11731012/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.11.11731012/pythonFiles/printEnvVariables.py
2023-06-22 16:38:50.142 [info] shell: bash
2023-06-22 16:38:50.617 [info] Running unittests with arguments: /home/paulo/.vscode-server-insiders/extensions/ms-python.python-2023.11.11731012/pythonFiles/unittestadapter/discovery.py,--port,44497,--uuid,c99d8672-d60e-40e1-8e5a-cad8b005d80b,--udiscovery,-v,-s,./tests,-p,*test*.py
2023-06-22 16:38:50.617 [info] > conda run -n my_env --no-capture-output python ~/.vscode-server-insiders/extensions/ms-python.python-2023.11.11731012/pythonFiles/get_output_via_markers.py ~/.vscode-server-insiders/extensions/ms-python.python-2023.11.11731012/pythonFiles/unittestadapter/discovery.py --port 44497 --uuid c99d8672-d60e-40e1-8e5a-cad8b005d80b --udiscovery -v -s ./tests -p *test*.py
2023-06-22 16:38:50.617 [info] cwd: .
2023-06-22 16:38:51.312 [info] Test server connected to a client.
2023-06-22 16:38:51.314 [info] Using result resolver for discovery
2023-06-22 16:38:51.314 [error] Unittest test discovery error
Failed to import test module: my_module_utils_test
Traceback (most recent call last):
File "/home/me/mambaforge/envs/my_env/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
module = self._get_module_from_name(name)
File "/home/me/mambaforge/envs/my_env/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
__import__(name)
File "/home/me/repos/my_repo/tests/my_module_utils_test.py", line 3, in <module>
from \
ModuleNotFoundError: No module named 'my_module'
The Pre-release version v2023.11.11731012 of Microsoft's Python extension for Visual Studio Code fails to discover one of my tests.
Behaviour
The command
Results in a Unittest test discovery error due to a module not being found.
Expected vs. Actual
In contrast, switching to release version v2023.10.1 of the same extension works without problems. It runs a different command, though:
Steps to reproduce:
Diagnostic data
python.languageServersetting: DefaultOutput for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)User Settings