You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[error] pytest test discovery error for workspace: /Users/fieoner/projects/pytest-bug
Error Occurred, traceback: Traceback (most recent call last):
File "/Users/fieoner/.vscode/extensions/ms-python.python-2024.14.1-darwin-arm64/python_files/vscode_pytest/__init__.py", line 389, in pytest_sessionfinish
session_node: TestNode | None = build_test_tree(session)
File "/Users/fieoner/.vscode/extensions/ms-python.python-2024.14.1-darwin-arm64/python_files/vscode_pytest/__init__.py", line 460, in build_test_tree
class_and_method = second_split[1] + "::" # This has "::" separator at both ends
IndexError: list index out of range
it could be fixed by replacing
class_and_method = second_split[1] + "::" # This has "::" separator at both ends
with
class_and_method = second_split[1] + "::" if len(second_split) > 1 else '' # This has "::" separator at both ends
Type: Bug
Behaviour
Discovering tests with pytest fails if the _nodeid of the test was changed to not contain ".py" during discovery.
Steps to reproduce:
You should get the following error:
it could be fixed by replacing
with
here https://github.com/microsoft/vscode-python/blob/main/python_files/vscode_pytest/__init__.py#L519
Extension version: 2024.14.1
VS Code version: Code 1.93.1 (Universal) (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z)
OS version: Darwin arm64 23.6.0
Modes:
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: