Pytest discovery fails with Miniconda installation [Windows]
See original GitHub issueEnvironment data
- VS Code version: Version: 1.34.0-insider (system setup)
- Extension version (available under the Extensions sidebar): 2019.4.11881 Publisher: Microsoft
- OS and version: 7 SP1 and up
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.3 Miniconda install
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
- Relevant/affected Python packages and their versions: pytest 4.x, currently on 4.4.1
Expected behaviour
I expect pytest to be discovered and used when I select “Run Tests”
Actual behaviour
Pytest isn’t discovered.
Steps to reproduce:
- Install Miniconda3, python version shouldn’t matter but I use 3.
- Install VS Code
- Install the Python extension
- Specify Miniconda path in Settings (even though this should be technically unnecessary due to global environment variables set in Windows)
- Create a python file, can be as simple as “Hello World!”.
- Select “Run Test”, Select “Discover Unit Tests” from command palette dropdown.
- No tests are discovered so prompt appears to configure test framework. Select pytest and choose default path (Root directory).
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
None provided for pytest discovery. Generic output as follows:
Starting Microsoft Python language server. [Info - 3:31:30 PM] GetCurrentSearchPaths C:\ProgramData\Miniconda3\python.exe [Info - 3:31:31 PM] Python search paths: [Info - 3:31:31 PM] c:\programdata\miniconda3\dlls [Info - 3:31:31 PM] c:\programdata\miniconda3\lib [Info - 3:31:31 PM] c:\programdata\miniconda3 [Info - 3:31:31 PM] c:\programdata\miniconda3\lib\site-packages [Info - 3:31:31 PM] c:\programdata\miniconda3\lib\site-packages\win32 [Info - 3:31:31 PM] c:\programdata\miniconda3\lib\site-packages\win32\lib [Info - 3:31:31 PM] c:\programdata\miniconda3\lib\site-packages\pythonwin [Info - 3:31:31 PM] Configuration search paths:
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging
)
Nothing about discovering pytest shown.
Edit: I do want to note that pylint works just fine so that’s getting detected. So whatever code is checking the path to pylint needs to be applied for pytest.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7
Top GitHub Comments
Well I guess it took an extremely long time to load but I finally have something in
Python Test Log
@WSLUser This should now work in the latest version of the extension.