Closed
Description
Environment data
- VS Code version: 1.39.2
- Extension version (available under the Extensions sidebar): 2019.10.44104
- OS and version: MS Windows 10
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.4
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): miniconda
- Relevant/affected Python packages and their versions: pytest
- 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): N/A
Expected behaviour
Discover all unit tests correctly with no problems as long as pythonFiles/testing_tools/run_adapter.py returns the correct JSON data
Actual behaviour
While discovering, the loading machinery instantiates some dynamic libraries (DLLs) that output to the standard output. Apparently, run_adapter.py tries to capture all the output as the JSON object rather than the relevant return from pytest.
Steps to reproduce:
- Create a C/C++ DLL that writes to stdout on load
- Create a Python SWIG wrapper for that DLL
- Write a pytest unittest that uses the SWIG wrapper
- Test discovery fails
Logs
Output for Python Test Log
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python Test log
)
python c:\<private path>\ms-python.python-2019.10.44104\pythonFiles\testing_tools\run_adapter.py discover pytest -- -s -n 4 <private project>
Test Discovery failed:
SyntaxError: Unexpected token E in JSON at position 23851