Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Unexpected token in JSON at position 23851 #8198

Closed
brgirgis opened this issue Oct 24, 2019 · 1 comment
Closed

SyntaxError: Unexpected token in JSON at position 23851 #8198

brgirgis opened this issue Oct 24, 2019 · 1 comment
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@brgirgis
Copy link

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:

  1. Create a C/C++ DLL that writes to stdout on load
  2. Create a Python SWIG wrapper for that DLL
  3. Write a pytest unittest that uses the SWIG wrapper
  4. Test discovery fails

Logs

Output for Python Test Log in the Output panel (ViewOutput, 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
@brgirgis brgirgis added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Oct 24, 2019
@kimadeline
Copy link

Duplicate of #6594

@kimadeline kimadeline marked this as a duplicate of #6594 Oct 24, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Oct 24, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants