Repository navigation
Test Icons Not Updating when using pytest #15260
Description
Issue Type: Bug
Hi,
While using the built-in Python test tab in VSCode, occasionally the test status icons (green checkmark or red X) get out of sync with the actual test results. As an example, I have tests that were once failing, and are now passing, but the icons still are red X's; when running tests, the icons dont update to be the spinning arrows, and after the tests are done, they are what they were before. At the bottom of the screen, the test status is correct, and inside the test file the test status is correct, its just the test explorer tab.
Note that closing VSCode entirely and re-opening it fixes the problem. I can't reliably reproduce, it just happens sometimes on some projects
Extension version: 2021.1.502429796
VS Code version: Code 1.52.1 (ea3859d4ba2f3e577a159bc91e3074c5d85c0523, 2020-12-16T16:34:46.910Z)
OS version: Windows_NT x64 10.0.18363
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i5-8365U CPU @ 1.60GHz (8 x 1896) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: disabled_off opengl: enabled_on protected_video_decode: enabled rasterization: enabled skia_renderer: disabled_off_ok video_decode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 15.75GB (6.86GB free) |
| Process Argv | --crash-reporter-id 72142afe-7e98-4075-91ad-09c713b0d234 |
| Screen Reader | no |
| VM | 0% |
A/B Experiments
vsliv368:30146709
vsreu685:30147344
openlogontheside:30221877
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30211401
wsl2promptcf:30224613
pythonvsdeb440:30248342
unusedpromptcf:30224611
folderexplorer:30224614
openfilemenu:30224647
pythonvsded773:30248341
pythonvspyt600cf:30247032
Activity
kimadeline commentedon Feb 1, 2021
Hi aaronsmith1234,
Thanks for the bug report! We investigate issues in order based on priority and severity, which includes the impact it has on your ability to use the extension to do productive work, and the number of people affected. If other users come forward and leave a comment demonstrating they are seeing/reproducing the problem then we will raise this issue's priority.
If you do end up having a sample project that we could use to reliably repro this issue, along with extra info like which test framework you're using, or your general workspace setup, that would be very useful 🙂
Thank you for your understanding and patience!
aaronsmith1234 commentedon Feb 2, 2021
For sure! General workspace settings is minimal; really only saying what test framework I'm using (Pytest)
[-]Test Icons Not Updating[/-][+]Test Icons Not Updating when using pytest[/+]rubenvdg commentedon Mar 2, 2021
Same here, the pytest icons are stale:
while all tests are actually passing:
c-byte88 commentedon Apr 21, 2021
Also experiencing the issue, icons don't update from ? when running using pytest.
Test running
Showing as passed in test output:
Environment Details
Running attached to a container via wsl2 (ubuntu-20.04)
Extension version: v2021.4.765268190
VS Code version: Code 1.52.2
OS version: Windows_NT x64 10.0.19042
Using Remote settings:
kimadeline commentedon Apr 21, 2021
Does any of you have a sample repo I could use to try and reproduce the issue? Also does it happen every time, or only with specific projects or configurations?
c-byte88 commentedon Apr 21, 2021
Kim-Adeline Miguel (@kimadeline) I've included the docker setup as it was pertinent to my environment. Thanks
https://github.com/nigelc-byte88/vscode-pytest-bugsample
This is happening every time on this project (the full version) and every project that follows this particular template layout. (i.e. using docker dev container)
aaronsmith1234 commentedon Apr 21, 2021
Kim-Adeline Miguel (@kimadeline) I've had it happen in a variety of projects and configurations, but haven't been able to reliably reproduce 😢Reloading the window always fixes it for me
followben commentedon May 21, 2021
Kim-Adeline Miguel (@kimadeline) - did you manage t repro with @nigelc-byte88's repo?
I'm seeing the same here, but not using remote testing:
vscode:
054a9295330880ed74ceaedda236253b4f39a335
Date: 2021-05-12T17:44:30.902Z (1 wk ago)
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Darwin x64 20.3.0
python extension: 2021.5.2
kimadeline commentedon May 21, 2021
Ben Stovold (@followben) Do you have a sample repo I could use as well?
kimadeline commentedon May 31, 2021
Thank you all for your patience!
@nigelc-byte88 I sadly couldn't reproduce the issue with repo:
I followed these steps:
srcas the source repoAnd the tests were discovered and ran when using Python 3.9.0 and pytest 6.2.4. Are there any steps I am missing?
followben commentedon May 31, 2021
Hi Kim-Adeline Miguel (@kimadeline) - for my case at least (pytest in venv under python 3.8+ running on macOS) it seems to be related to the addition of
python.testing.pytestArgs. I've created a repo that reproduces the issue here: https://github.com/followben/vscode-pytest-iconsc-byte88 commentedon Jun 1, 2021
Thanks for checking Kim-Adeline Miguel (@kimadeline), we use wsl/docker and use the vscode settings included in the repo here. Which does includes python.testing.Pytest args, so would align with Ben Stovold (@followben) hypothesis.
luabud commentedon Jul 29, 2021
This is fixed by #16769 😊