-
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
Discovering tests with pytest fails if the ".py" extension is removed from _nodeid #24172
Comments
To clarify you have your own plugin which you use to modify the ids? Could you clarify the use case for changing these Ids? I can look into changing the way we parse the pytest ids into the nested structure but with nested classes it is hard to determine what is a path / file and what isn't |
I'm using pytest to test some sql queries, so for those tests I use |
Just to second this and to add another (similar) use-case: I am working on a plugin that generates tests from test definitions in yaml files. The tests are loaded from python files, but parametrized with information from the yaml files, which are also taken to be the This is inspired by the Network Unit Testing System, which might provide another use-case. |
Sorry for the delay- I will investigate. We seems to have a few plugins which cause edits to tests / test names and how we can try and fix those issues |
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off. Happy Coding! |
Hi! Can you give me an example of the test id and then also the expected nested folder structure from there? I use the
|
Type: Bug
Behaviour
Discovering tests with pytest fails if the _nodeid of the test was changed to not contain ".py" during discovery.
Steps to reproduce:
You should get the following error:
it could be fixed by replacing
with
here https://github.com/microsoft/vscode-python/blob/main/python_files/vscode_pytest/__init__.py#L519
Extension version: 2024.14.1
VS Code version: Code 1.93.1 (Universal) (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z)
OS version: Darwin arm64 23.6.0
Modes:
python.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
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
A/B Experiments
The text was updated successfully, but these errors were encountered: