Add VSCode settings for pytest configuration#753
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. |
rgommers
left a comment
There was a problem hiding this comment.
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 |
|
Is there anything missing here? I would like to work on the other PR, but for this it's more convenient to have this PR merged first. |
|
Plese rebase instead of merging the main branch in the PR branch next time. |
77bc3d9 to
26bef0a
Compare
Include settings to enable pytest in VSCode.