-
Notifications
You must be signed in to change notification settings - Fork 76
Add VSCode settings for pytest configuration #753
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
base: main
Are you sure you want to change the base?
Conversation
Does VSCode really need to add this to all projects? I don't think we should add a configuration file for every editor or IDE someone may use to work on the project. |
Well, if you want vscode to automatically figure out how to run the test suite then it needs a machine readable way to figure out what test suite technology is used. The python ecosystem has been resistant to date to defining a replacement for the setuptools test entrypoint, so there's not actually anything that vscode can do here. Piggybacking off of meson's own well-defined test command might help though. |
Yes, it's needed since otherwise vscode will not recognize the existing pytests and show them in its test inferface which provides a quite convenient way to re-run only a few tests and other helpful tooling.
My impression is that vscode directly calls pytest to discover tests etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tobiasdiez.
This doesn't hurt and I don't think there's a better option that is generic across IDEs here (a la EditorConfig for formatting settings), so this seems okay to me.
In theory it could use meson via vscode-meson! :) |
I had a look at https://github.com/mesonbuild/vscode-meson, but not being a VSCode user, I'm not sure from the README how that would work exactly for hooking up a pytest invocation. It seems very reasonable for working on |
Nor me, but I assume vscode-meson allows you to configure a build with |
It's not just about running the tests (for which vscode-meson probably provides a task-integration), but also discovering all tests with detailed info (eg |
Include settings to enable pytest in VSCode.