forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugregressionBug didn't exist in a previous releaseBug didn't exist in a previous release
Description
When exit handlers that print to standard out are registered using the atexit module, pytest test discovery fails.
Environment data
- VS Code version: 1.36.1
- Extension version (available under the Extensions sidebar): 2019.6.24221
- OS and version: Ubuntu Linux 18.04.2
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.4
- Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv
- 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): Language Server
Expected behaviour
I would expect the relevant tests to be discovered.
Actual behaviour
Test discovery fails because extra text is appended to whatever output is used to store the JSON description of the discovered tests, which subsequently causes a SyntaxError when parsing.
Steps to reproduce:
Allow test discovery to run on the minimal demonstration repository here: https://github.com/joel-wright/pytest-discovery-atexit
Logs
Output for Python Test Log:
python /home/jjw/.vscode/extensions/ms-python.python-2019.6.24221/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s --cache-clear
Test Discovery failed:
SyntaxError: Unexpected token I in JSON at position 436
Metadata
Metadata
Assignees
Labels
area-testingbugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bugregressionBug didn't exist in a previous releaseBug didn't exist in a previous release