-
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
VSCode clears pytest's failed-tests cache on save or rediscover tests #21386
Comments
This appears to be the behaviour described in this Stack Overflow post: https://stackoverflow.com/questions/62554902/how-to-prevent-vscode-ms-python-from-clearing-test-results |
Hi! Can you include your logs? You can do this by going to view -> output and select python in the dropdown on the right. Thanks! |
I have turned of "rediscover tests on save", so I no longer lose all test results every time I save a file, but it still happens every time I run test rediscovery. The output is:
Indeed, I cannot easily use the built-in testing tools (the little green arrows next to test cases) as the result display does not show enough information to understand the failure when using the |
Hello! We are wrapping up a rewrite on testing infrastructure which is aimed at improving buggy behavior and making pytest work in a more native way. If you could give your issue a try on the rewrite (steps explained below) and let me know the status that would be most helpful in understanding the ongoing shortcomings and helping me to determine the next steps. Thanks! To test you need to be on vscode insiders and then add this setting to your users settings.json "python.experiments.optInto": ["pythonTestAdapter"]. This is currently what is needed but we are in the process of switching all users to the rewrite but are doing so incrementally so if you do not have insiders, watch our release notes to get updated on when it will begin to hit stable. Thanks! |
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! |
going to move the discussion here since these two are the same: #21197 |
Type: Bug
pytest
.pytest --last-failed
.pytest --last-failed
.Expected behaviour: both
--last-failed
runs run only the failing test(s).Observed behaviour: the first
--last-failed
run runs the failing test(s), but after saving a file, the next--last-failed
run reports no previously failed tests and runs all of them.I can confirm that after running the test rediscovery my
.pytest_cache/v/cache/lastfailed
is removed.Extension version: 2023.8.0
VS Code version: Code 1.78.2 (Universal) (b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T14:44:45.204Z)
OS version: Darwin arm64 22.5.0
Modes:
Sandboxed: Yes
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: