-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyTest optional args don't support wildcards #19918
Comments
Hello, we are aware of buggy behavior on pytest discovery and running in vscode. We are currently work on a rewrite of how pytest works in vscode and hope this rewrite will fix this and similar bugs. The main issue which will be working on is here: #17242, and progress will be updated on this issue. Thank you! |
Hi! Currently we run pytest discovery using ChildProcess spawn function from nodejs. The spawn function handles the args as an array of strings and therefore does not expand wildcards in args. I think for this reason this is currently not possible with the extension. @karthiknadig, would this be feasible at some point? Looked and it seems hard to switch from |
opened pytest-dev/pytest#11319 to confirm |
Yes it is true they don't support it on pytest.main but I was reminded that we could handle it via glob from the stdlib to expand before passing it in. @karthiknadig thoughts on if this would be worthwhile/doable? |
@karthiknadig, following up on this. Confirming it is not something we want to work on right? |
This is now handled via test explorer. If you want to run a subset of the test, you can use the search field in the test explorer and select the test or test files that you want to run.
That is correct. PyTest doesn't provide us with an API to do this. Given that this is shell dependent, and can get really complex to support generally, |
Thanks @eleanorjboyd and @karthiknadig for following up on this. |
Type: Bug
Behaviour
Expected vs. Actual
Expected: pytest's positional arguments support wildcards to specify what test directories/files you want to run. E.g.
pytest mydir/**/*_test.py
.Actual: Something about the VSCode-Python extension interprets these wildcards literally and results in an
ERROR: file not found "mydir/**/*_test.py"
Steps to reproduce:
Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2022.15.12711056
VS Code version: Code 1.71.2 (Universal) (74b1f979648cc44d385a2286793c226e611f59e7, 2022-09-14T21:05:37.721Z)
OS version: Darwin arm64 21.6.0
Modes:
Sandboxed: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
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
A/B Experiments
The text was updated successfully, but these errors were encountered: