Pytest code coverage run fails after attempting to parse non-Python file #24703
Labels
area-testing
bug
Issue identified by VS Code Team member as probable bug
triage-needed
Needs assignment to the proper sub-team
Type: Bug
Behaviour
Steps to reproduce:
git clone https://github.com/microsoft/sarif-tools.git
cd sarif-tools
poetry env use <path to 3.8 python.exe>
poetry install
code-insiders .
.venv
interpreter is selected.pytest
. Root directory
Actual: Coverage run fails because the coverage tool attempts to parse a non-Python file (text or html) as Python.
Expected: Coverage run succeeds. If you copy the
pytest
command line args used within VS Code (from the top of the Test Results pane), drop the leading-p vscode_pytest
, reformat the list of args into a valid command line arg set, and runpoetry run pytest <all those args>
on the command line, the coverage run will succeed, as shown below:Command line coverage run output
Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Extension version: 2024.23.2024121901
VS Code version: Code - Insiders 1.97.0-insider (8cc255e03ac7c51804cea1194b1ea864bbe2ccb6, 2025-01-06T05:06:20.407Z)
OS version: Windows_NT x64 10.0.26100
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
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments
The text was updated successfully, but these errors were encountered: