Repository navigation
pytest 5.1.0 seems to break the test adapter #6990
Copy link
Copy link
Closed
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityIssue identified as high-priority
Milestone
Description
Issue Type: Bug
After updating VSCode from v1.36.1 to v1.37.1 (in WSL), pytest unit tests are no longer displaying green/red status in the side bar. An error pop-up is displayed with the following message:
There was an error in running the tests.
Source Python (Extension)
The OUTPUT tab indicates that the test passed, but there is also an error message that seems like it is related to the extension issue:
============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-5.1.0, py-1.8.0, pluggy-0.12.0
rootdir: /mnt/c/Users/.../
plugins: cov-2.7.1
collected 1 item
tests/test___init__.py . [100%]
-------------- generated xml file: /tmp/tmp-2499XLU6ay233ncl.xml ---------------
============================== 1 passed in 0.06s ===============================
Error: TypeError: Cannot read property '$' of undefined
Extension version: 2019.8.30787
VS Code version: Code 1.37.1 (f06011ac164ae4dc8e753a3fe7f9549844d15e35, 2019-08-15T16:17:55.855Z)
OS version: Windows_NT x64 10.0.17134
Remote OS version: Linux x64 4.4.0-17134-Microsoft
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Xeon(R) CPU X5650 @ 2.67GHz (12 x 3800) |
| GPU Status | 2d_canvas: enabled flash_3d: enabled flash_stage3d: enabled flash_stage3d_baseline: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on native_gpu_memory_buffers: disabled_software oop_rasterization: disabled_off protected_video_decode: unavailable_off rasterization: enabled skia_deferred_display_list: disabled_off skia_renderer: disabled_off surface_synchronization: enabled_on video_decode: enabled viz_display_compositor: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 24.00GB (14.93GB free) |
| Process Argv | --folder-uri=vscode-remote://wsl+default/mnt/c/Users/.../ --remote=wsl+default |
| Screen Reader | no |
| VM | 50% |
| Item | Value |
|---|---|
| Remote | WSL |
| OS | Linux x64 4.4.0-17134-Microsoft |
| CPUs | Intel(R) Xeon(R) CPU X5650 @ 2.67GHz (12 x 3800) |
| Memory (System) | 24.00GB (14.93GB free) |
| VM | 50% |
Reactions are currently unavailable
Metadata
Metadata
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityIssue identified as high-priority
Activity
marsfan commentedon Aug 16, 2019
Jason (@krazyace78) @pvscbot
Also mentioning Johnnyxy and BLeAm as I see they posted a reaction to it.
I have the same issue.
I believe this is unrelated to updating Visual Studio Code. I just ran some tests, and the issue seems to be with pytest 5.1.0.
Try downgrading to pytest 5.0.1 (via
pip install -U pytest==5.0.1), as that fixed it for me.Attached is my output from the developer console:
marsfan commentedon Aug 16, 2019
Upon further examination, the output between 5.1.0 and 5.0.1 seems to be the same, so I do not know why this would trigger an error, but I know that downgrading to 5.0.1 fixed it for me.
BLeAm commentedon Aug 17, 2019
Gabe R. (@marsfan) Thank you for mentioning me and the workaround.
krazyace78 commentedon Aug 17, 2019
Thank you for the workaround Gabe R. (@marsfan)!
vthorsteinsson commentedon Aug 18, 2019
I have the same issue, and the workaround did the trick for me. Thanks Gabe R. (@marsfan)!
cornel-masson commentedon Aug 19, 2019
+1 works for me now Gabe R. (@marsfan)
In case someone has the same issues: to downgrade pytest to 5.0.1, uninstall it first (e.g. pipenv uninstall pytest), then add the dependency in your Pipfile as "<=5.0.1" and re-install (e.g. pipenv install pytest).
Johnnyxy commentedon Aug 19, 2019
Additionally, if you do not use any environments:
global install:
pip install --force-reinstall pytest==5.0.1user install:
pip install --user --force-reinstall pytest==5.0.1[-]TEST:PYTHON pytest unit test status is no longer working[/-][+]pytest 5.1.0 seems to break the test adapter[/+]8 remaining items
pin pytest version
[ENH] add code server (#182)
ezequias commentedon Sep 17, 2019
The suggestion of Gabe R. (@marsfan) was great but while I am debugging I faced with the following error after the last instruction, my assertion
self.assertEqual(response.status_code, 200)The error I got (after the last F10) is:
Could not load source '': Source unavailable.
JosephTLyons commentedon Sep 17, 2019
Downgrading to 5.0.1 fixed my issues with VS Code and PyTest
Clean up XUnitParser and add tests. (#7263)
wagneripjr commentedon Sep 23, 2019
Downgrading pytest fixed my issues, thanks Gabe R. (@marsfan)
karrtikr commentedon Sep 23, 2019
Hi all, it's fixed in the insiders version of the extension now. (You can use
Switch to insiders weeklycommand from CmdPalette to download the latest version of the extension)The fix will be out in the next stable release.
Update pytest
Lock pytest to v5.0.1 to handle vscode-python issue #6990