Closed
Closed
Copy link
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugverifiedVerification succeededVerification succeeded
Milestone
Description
Environment data
- VS Code version: 1.38.1
- Extension version: 2019.9.34911
- OS and version: WSL (Windows 10.0.18362 Build 18362)
- Python version: Conda 3.7.4
- Type of virtual environment used: Conda
- Relevant/affected Python packages and their versions: pytest-5.0.1
Expected behaviour
I am using python in a conda environment in WSL. I configured VS Code to use the correct WSL python interpreter, and I expected that the code adornments would be available.
Actual behaviour
VSCode discovers the test and it can be run , but there is no visible adornment.
Interestingly, I installed conda/python on Windows, and when I switch over to that interpreter in VS Code, the code adornments are available.
Windows (code adornments available)

Steps to reproduce:
- Install pytest.
- Write a test
- Choose the WSL Conda python interpreter
- Code adornments not available.
vs. - Disconnect from WSL
- Choose the Windows Conda python interpreter
- Code adornments become available
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
> ~/miniconda3/envs/APT/bin/python ~/.vscode-server/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s .
cwd: ~/PhillipYen/Desktop/project1
> conda info --json
> ~/miniconda3/envs/APT/bin/python ~/.vscode-server/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s --cache-clear .
cwd: ~/PhillipYen/Desktop/project1
Reacted by Dominik Bartsch
Metadata
Metadata
Assignees
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugverifiedVerification succeededVerification succeeded

Activity
yphillip commentedon Sep 17, 2019
yphillip commentedon Sep 17, 2019
My colleague showed me another way to start VS Code with WSL, and in this way, the code adornments become available:
Still unsure why this method works for showing the adornments, but the
code .from the WSL Windows Terminal method doesn't work.yphillip commentedon Sep 18, 2019
I think I figured it out. The problem has something to do with running
code .from a directory derived from a symbolic link.When I
cdto the absolute path and then runcode ., the code adornments become available.cd
Before, I had
cd'ed to the path via a symbolic link and then runcode ., which wouldn't show the code adornments.ericsnowcurrently commentedon Sep 19, 2019
Thanks for letting us know about this, Phillip Yen (@yphillip). I was able to reproduce the problem via both remote-WSL and remote-SSH (to a linux host). I was not able to reproduce this with "code ." directly on linux. We will investigate further.
Repro
To reproduce:
mkdir /tmp/test-7443ln -s /tmp/test-7443 /tmp/test-7443-lnk/tmp/test-7443/test_spam.pywith content ofdef test_spam(): assert True/tmp/test-7443-lnkin VS Code (on WSL:code /tmp/test-7443-lnk; over SSH: use UI)test_spam.pyVia remote-WSL or remote-SSH, the code lens for the test does not show up. (Note that the test does show up in the test explorer on the left.) Both remote sessions work correctly if
/tmp/test-7443is opened directly (rather than the symlink).ericsnowcurrently commentedon Sep 19, 2019
Note that this may also be a problem with upstream VS Code, rather than the extension. We'll figure that out.
[-]Code Adornment doesn't show for pytest in WSL[/-][+]Testing code lenses don't show for remote sessions to a directory symlink.[/+]sammo commentedon Sep 30, 2019
Same issue here. No adornments for
pytest. I'm using vscode on mac Mojave and a python 3.7.3 conda environment.BoPeng commentedon Jun 3, 2020
Same here, I do not know what is WSL ad I do not have any symbolic link in the path. I am in conda python 3.8 environment under mac catalina.
Edit: I really do not know what happened, these
Run Testadornments suddenly appeared.brettcannon commentedon Jul 29, 2021
In our upcoming test provider we won't have codelenses, but there will be gutter icons which do work under e.g. WSL.