forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Description
The issues is similar to #8678 , but is about unittest, not pytest
Environment data
- VS Code version: 1.44.0
- Extension version: 2020.4.74986
- OS and version: Windows 10 Pro 1903
- Python version: python 3.7.4 x64
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
- Relevant/affected Python packages and their versions: N/A
- Relevant/affected Python-related VS Code extensions and their versions: N/A
- Jedi or Language Server? (i.e. what is
"python.jediEnabled"set to; more info How to update the language server to the latest stable version #3977): True - Value of the
python.languageServersetting: Microsoft
Expected behaviour
Set python.testing.cwd to correct directory in Workspace settings.
Try discovering tests.
The test discovery uses the provided cwd.
Actual behaviour
The test discovery ignores the provided cwd.
Output for Python in the Output panel:
Here is what I see during test discovery:
(My python.testing.cwd is set to "sdk/python" or "<workspace_root>/sdk/python").
> .../python ...\.vscode\extensions\ms-python.python-2020.4.74986\pythonFiles\pyvsc-run-isolated.py -c "
import unittest
loader = unittest.TestLoader()
suites = loader.discover(".", pattern="*test*.py")
print("start") #Don't remove this line
for suite in suites._tests:
for cls in suite._tests:
try:
for m in cls._tests:
print(m.id())
except:
pass"
cwd: <workspace_root>
See how the bottom line prints a different value of cwd.
P.S. I'm seeing the above log twice every time I try discovering the tests...
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug