-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
python.testing.pytestArgs ignores multiple instances of the same arg #22999
Comments
I think this was introduced by #22885 here: 75ed73e#diff-19ce457a2aaf03c9ce746ac804e645758ead9dccd86e7fdd4a3367116be9b769L69-R114 |
It's worse than "ignored" — this causes an error for me. We use a custom pytest plugin which we enable with these VSCode settings:
and since 2024.2.0 this causes my pytest collection to fail with "ERROR: file or directory not found: no:python". This is the command line VS Code is using:
Note that it's missing the second "-p". |
I'm seeing this issue when ignoring multiple directories. Only the last ignore is used: settings.json: "python.testing.pytestArgs": [
"--ignore=src/application1/test",
"--ignore=src/application2/test",
"--ignore=src/application3/test",
"./src"
], Python Output 2024-02-29 09:37:39.408 [info] > /bin/python3 -m pytest -p vscode_pytest --collect-only --ignore=src/application3/test ./src |
thank you for the bug report- yes I think you are right with the commit id that introduces this. I will work on a fix- thanks |
Hello, ./libs/libA When discovering the tests, I want to ignore libA tests so I added When running the command in the terminal, it does work just fine.
|
Hello! The fix for this has been merged and is out on the most recent release of vscode insiders. Is someone able to verify that the bug is fixed for them? If so, we can then put a point release out for stable with the fix. Thanks @anthonykim1 for visibility |
@eleanorjboyd does that include the code-insiders snap for linux?
I also installed the pre-release version of the Python extension: With these versions I still get the same symptoms reported in my comment above. |
@eleanorjboyd |
microsoft/vscode-python#23148) fixes microsoft/vscode-python#22999 reverts some changes made here: microsoft/vscode-python#22885
microsoft/vscode-python#23148) fixes microsoft/vscode-python#22999 reverts some changes made here: microsoft/vscode-python#22885
Type: Bug
Behaviour
Expected vs. Actual
This is a new issue that began appearing as of v2024.2
Expected:
pytestArgs which allow multiple of the same arg (e.g. --ignore=path/to/ignored/dir) pass all instances of the arg in the list to pytest
Actual:
Only the last instance of multiple args in the list are passed to pytest
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
)Actual command: sent:
Expected command sent:
User Settings
Extension version: 2024.2.0
VS Code version: Code 1.86.1 (31c37ee8f63491495ac49e43b8544550fbae4533, 2024-02-07T09:08:20.941Z)
OS version: Windows_NT x64 10.0.19045
Modes:
The text was updated successfully, but these errors were encountered: