You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PyTest should detect all available tests provided they match the requirements on naming conventions.
Actual behaviour
PyTest returns the error:
Test Discovery failed:
SyntaxError: Unexpected token F in JSON at position 0
This seems to be due to the discovery reading from stdout, as it picks up the first letter of a message that is printed from within a python import, and therefore cannot parse it as JSON.
I think this is only an issue with prints occuring from sources external to python.
Steps to reproduce:
Create a minimal working example as follows:
2 directories: "some_module", "tests"
import sys, os
sys.path.append(os.path.join(__file__, os.pardir, os.pardir))
from unittest import TestCase
from some_module import funcs
class Tester(TestCase):
def test_import(self):
pass
Now go to python.settings and check that pytest is being used
Check that the test appears in the "TEST: PYTHON" panel
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
python /home/eel23943/.vscode-server/extensions/ms-python.python-2019.9.34911/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s --cache-clear
Test Discovery failed:
SyntaxError: Unexpected token F in JSON at position 0
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)
Error Python Extension: 2019-09-24 09:16:31: Failed to parse discovered Test [Error: FrameworkManager-[Notice] Welcome to Mantid 4.1.0FrameworkManager-[Notice] Please cite: http://dx.doi.org/10.1016/j.nima.2014.07.029 and this release: http://dx.doi.org/10.5286/Software/Mantid4.1DownloadInstrument-[Notice] All instrument definitions up to date[{"rootid": ".", "tests": [{"source": ...
Note: The rest of this message looks to be the correct format, but its very long so I'm only posting the start.
The text was updated successfully, but these errors were encountered:
Environment data
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version #3977): JediExpected behaviour
PyTest should detect all available tests provided they match the requirements on naming conventions.
Actual behaviour
PyTest returns the error:
This seems to be due to the discovery reading from stdout, as it picks up the first letter of a message that is printed from within a python import, and therefore cannot parse it as JSON.
I think this is only an issue with prints occuring from sources external to python.
Steps to reproduce:
2 directories: "some_module", "tests"
"some_module" directory: "__init__.py", "funcs.py", "run_me.bat"
"__init__.py" : empty
"funcs.py" :
"run_me.bat" :
"tests" directory: "__init__.py", "test_imports.py"
"__init__.py" : empty
"test_imports.py" :
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Python
Python Test Log
Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)Note: The rest of this message looks to be the correct format, but its very long so I'm only posting the start.
The text was updated successfully, but these errors were encountered: