microsoft / vscode-python

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

Python test discovery is incompatible with pytest-ruff. #24326

Open niksite opened 1 month ago

niksite commented 1 month ago

Type: Bug

Behaviour

When discovering tests with pytest-ruff enabled (pytest --ruff command) only very small subset of the tests is available.

Steps to reproduce:

  1. pip install pytest-ruff
  2. Add --ruff to the addopts in pytest.ini or into the pytestArgs.
  3. Try to discover the tests in multiple folders (e.g., a Django project with 'tests' subfolders in every Django app folder).

Extension version: 2024.17.2024102101 VS Code version: Code 1.94.2 (Universal) (384ff7382de624fb94dbaf6da11977bba1ecd427, 2024-10-09T16:08:44.566Z) OS version: Darwin arm64 24.0.0 Modes:

User Settings

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

Installed Extensions |Extension Name|Extension Id|Version| |---|---|---| |Beautify css/sass/scss/less|michelemelluso.code-beautifier|2.3.3| |Code Spell Checker|streetsidesoftware.code-spell-checker|3.0.1| |Dash|deerawan.vscode-dash|2.4.0| |direnv|mkhl.direnv|0.17.0| |Django|batisteo.vscode-django|1.15.0| |djLint|monosans.djlint|2024.7.0| |Docker|ms-azuretools.vscode-docker|1.29.3| |ESLint|dbaeumer.vscode-eslint|3.0.10| |Even Better TOML|tamasfe.even-better-toml|0.19.2| |Excel Viewer|GrapeCity.gc-excelviewer|4.2.62| |File Utils|sleistner.vscode-fileutils|3.10.3| |GitHub Copilot|GitHub.copilot|1.241.0| |GitHub Copilot Chat|GitHub.copilot-chat|0.21.2| |GitHub Pull Requests|GitHub.vscode-pull-request-github|0.98.0| |GitLens — Git supercharged|eamodio.gitlens|15.6.2| |Go|golang.go|0.42.1| |GraphQL: Language Feature Support|GraphQL.vscode-graphql|0.12.0| |GraphQL: Syntax Highlighting|GraphQL.vscode-graphql-syntax|1.3.6| |JavaScript Debugger|ms-vscode.js-debug|1.94.0| |JavaScript Debugger Companion Extension|ms-vscode.js-debug-companion|1.1.3| |Jupyter|ms-toolsai.jupyter|2024.9.1| |Jupyter Cell Tags|ms-toolsai.vscode-jupyter-cell-tags|0.1.9| |Jupyter Keymap|ms-toolsai.jupyter-keymap|1.1.2| |Jupyter Notebook Renderers|ms-toolsai.jupyter-renderers|1.0.19| |Jupyter Slide Show|ms-toolsai.vscode-jupyter-slideshow|0.1.6| |keyboard-scroll|selbh.keyboard-scroll|0.1.0| |Live Preview|ms-vscode.live-server|0.4.15| |Makefile Tools|ms-vscode.makefile-tools|0.11.13| |markdownlint|DavidAnson.vscode-markdownlint|0.56.0| |Mypy Type Checker|ms-python.mypy-type-checker|2024.0.0| |Open In GitHub|sysoev.vscode-open-in-github|1.18.0| |Playwright Test for VSCode|ms-playwright.playwright|1.1.11| |Project Manager|alefragnani.project-manager|12.8.0| |Pylance|ms-python.vscode-pylance|2024.10.1| |Python|ms-python.python|2024.17.2024102101| |Python Debugger|ms-python.debugpy|2024.12.0| |Rainbow CSV|mechatroner.rainbow-csv|3.12.0| |Remote - SSH: Editing Configuration Files|ms-vscode-remote.remote-ssh-edit|0.87.0| |REST Client|humao.rest-client|0.25.1| |Ruff|charliermarsh.ruff|2024.52.0| |SemanticDiff|semanticdiff.semanticdiff|0.9.0| |shell-format|foxundermoon.shell-format|7.2.5| |Table Visualizer for JavaScript Profiles|ms-vscode.vscode-js-profile-table|1.0.10| |vscode-random|jrebocho.vscode-random|1.12.0| |Vue - Official|Vue.volar|2.1.6| |YAML|redhat.vscode-yaml|1.15.0|
System Info |Item|Value| |---|---| |CPUs|Apple M3 Max (16 x 2400)| |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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|3, 2, 3| |Memory (System)|64.00GB (31.16GB free)| |Process Argv|--crash-reporter-id eea03661-39de-4e7a-b244-2386eea107db| |Screen Reader|no| |VM|0%|
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 h48ei257:31000450 pythontbext0:30879054 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 0ee40948:31013168 dvdeprecation:31068756 dwnewjupyter:31046869 newcmakeconfigv2:31071590 impr_priority:31102340 nativerepl2:31139839 refactort:31108082 pythonrstrctxt:31112756 wkspc-onlycs-t:31132770 wkspc-ranged-t:31151552 cf971741:31144450 defaultse:31146405 iacca2:31156134 notype1cf:31157160 5fd0e150:31155592 dwcopilot:31164048 icondisabled:31158250 ```
eleanorjboyd commented 1 month ago

will investigate - thank you for the issue report!