microsoft / vscode-python

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

pytest can not find result with disable_test_id_escaping_and_forfeit_all_rights_to_community_support = True #21077

Closed PaleNeutron closed 1 year ago

PaleNeutron commented 1 year ago

Type: Bug

Behaviour

Expected vs. Actual

Test result should be found but not.

Without disable_test_id_escaping_and_forfeit_all_rights_to_community_support = True, everything is OK.

Steps to reproduce:

First create pages/24_📚_file.py

Then, create pytest.ini with

[pytest]
disable_test_id_escaping_and_forfeit_all_rights_to_community_support = True

test.py :

import os
import pytest

pages = [f.path for f in os.scandir("pages") if f.is_file()]

@pytest.mark.parametrize("page_path", pages)
def test_all_pages(page_path):
    """Run all pages by import"""
    print(page_path)

Diagnostic data

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

``` > /usr/bin/python ~/.vscode-server/extensions/ms-python.python-2023.6.1/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear tests cwd: . > /usr/bin/python -m pytest --rootdir . --override-ini junit_family=xunit1 --junit-xml=/tmp/tmp-15908Ejzmxpa49dBJ.xml ./tests/test_pages.py::test_all_pages[pages/12_\U0001f4da_\u4f30\u503c\u5206\u6790-\u5206\u5316\u6307\u6570.py] cwd: . > /usr/bin/python ~/.vscode-server/extensions/ms-python.python-2023.6.1/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear tests cwd: . > /usr/bin/python ~/.vscode-server/extensions/ms-python.python-2023.6.1/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear tests cwd: . > /usr/bin/python ~/.vscode-server/extensions/ms-python.python-2023.6.1/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir . -s --cache-clear tests cwd: . > /usr/bin/python -m pytest --rootdir . --override-ini junit_family=xunit1 --junit-xml=/tmp/tmp-159083ga3P7JmuWDr.xml ./tests/test_pages.py::test_all_pages[pages/12_📚_估值分析-分化指数.py] cwd: . ```

User Settings

``` languageServer: "Pylance" sortImports • args: "" formatting • provider: "yapf" • blackArgs: "" testing • pytestArgs: "" • pytestEnabled: true • unittestArgs: "" ```

Extension version: 2023.6.1 VS Code version: Code 1.77.3 (704ed70d4fd1c6bd6342c436f1ede30d1cff4710, 2023-04-12T09:16:02.548Z) OS version: Windows_NT x64 10.0.19043 Modes: Sandboxed: Yes Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2 Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2 Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz (16 x 2496)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|31.69GB (7.21GB free)| |Process Argv|--folder-uri=vscode-remote://wsl+Ubuntu/home/john/projects/urban_invest --remote=wsl+Ubuntu --crash-reporter-id e0824f99-80f6-4908-9ff9-e2859bce8a44| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 5.15.90.1-microsoft-standard-WSL2| |CPUs|11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz (16 x 2495)| |Memory (System)|15.62GB (7.96GB free)| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 5.15.90.1-microsoft-standard-WSL2| |CPUs|11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz (16 x 2495)| |Memory (System)|15.62GB (7.96GB free)| |VM|0%| |Item|Value| |---|---| |Remote|WSL: Ubuntu| |OS|Linux x64 5.15.90.1-microsoft-standard-WSL2| |CPUs|11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz (16 x 2495)| |Memory (System)|15.62GB (7.96GB free)| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931:30280409 vshan820:30294714 vstes263:30335439 vscorecescf:30445987 pythondataviewer:30285071 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 pynewext54:30695312 azure-dev_surveyone:30548225 vsccc:30610678 nodejswelcome1:30587005 3biah626:30602489 pyind779:30671433 89544117:30613380 pythonsymbol12:30671437 a9j8j154:30646983 vsctsb:30705553 functionswalk:30687959 pythonms35:30701012 pythonfmttext:30716742 ```
eleanorjboyd commented 1 year ago

Hello! We currently do not provide support with this setting enabled. That being said we are doing a rewrite which might help with your issue. You can follow along here: https://github.com/microsoft/vscode-python/issues/17242. Thanks