Repository navigation
VSCode Pytest Discovery Fails With Unhelpful Error #22513
Description
Discussed in #22491
Originally posted by dylan-at-na November 17, 2023
PyTest Discovery consistently failing, the error message isn't telling me much. Error messages follow (full log at end of message).
The Python extension has run into an unexpected situation while processing a pytest node during test discovery. Please Please open an issue at: https://github.com/microsoft/vscode-python/issues and paste the following output there.
INTERNALERROR> NotImplementedError: Unexpected pytest node (see printed output).
NotImplementedError: Unexpected pytest node (see printed output).
Exception: pytest discovery failed (exit code 3)
I'm (attempting) to run using poetry. Full log below but additionally I've come across a number of issues which seem to swap around. I'm not sure where to go with the above but I've also come across regular ModuleNotFound import errors during Test Discovery that aren't present when executing a test with PyTest. If anybody is able to advise on that.
2023-11-16 16:35:55.046 [info] Discover tests for workspace name: projectroot - uri: /u/dyl/repos/projectroot
2023-11-16 16:35:55.066 [info] > ./qaframeworks/qa1/.venv/bin/python ~/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir ./qaframeworks/qa1 -s --cache-clear .
2023-11-16 16:35:55.066 [info] cwd: ./qaframeworks/qa1
2023-11-16 16:35:59.022 [error] Error discovering pytest tests:
[n [Error]: ============================= test session starts ==============================
platform linux -- Python 3.10.4, pytest-7.4.3, pluggy-1.3.0
rootdir: /u/dyl/repos/projectroot/qaframeworks/qa1
configfile: pytest.ini
plugins: anyio-4.0.0, hypothesis-6.89.0, subtests-0.7.0, dotenv-0.5.2, xdist-3.4.0, schemathesis-3.21.0, cov-4.1.0, timeout-2.2.0, env-1.1.1
['/u/dyl/repos/projectroot/qaframeworks/qa1/environ/tests', '/u/dyl/repos/projectroot/qaframeworks/qa1/suites', '/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools', '/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles', '/u/dyl/repos/projectroot/qaframeworks/qa1/lib', '/u/dyl/repos/projectroot/qaframeworks/qa1', '/u/dyl/repos/projectroot/qaframeworks', '/u/dyl/repos/projectroot', '/u/dyl/repos/projectroot/qaframeworks/lib', '/u/dyl/.pyenv/versions/3.10.4/lib/python310.zip', '/u/dyl/.pyenv/versions/3.10.4/lib/python3.10', '/u/dyl/.pyenv/versions/3.10.4/lib/python3.10/lib-dynload', '/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages']
SHELL=/bin/csh
PYENV_SHELL=bash
PYTHONUNBUFFERED=1
ART_DIR=XXX
APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL=1
ELECTRON_RUN_AS_NODE=1
SWAGGER_FILES=XXX
VSCODE_AMD_ENTRYPOINT=vs/workbench/api/node/extensionHostProcess
GPG_TTY=not a tty
PWD=/u/dyl
LOGNAME=dyl
XDG_SESSION_TYPE=tty
CLIENT_SECRET=XXX
MOTD_SHOWN=pam
HOME=/u/dyl
LANG=en_US.UTF-8
VIRTUAL_ENV=/u/dyl/repos/projectroot/qaframeworks/qa1/.venv
CLIENT_ID=XXX
VSCODE_AGENT_FOLDER=/u/dyl/.vscode-server
VSCODE_L10N_BUNDLE_LOCATION=
SSH_CONNECTION=XXX
XDG_SESSION_CLASS=user
VSCODE_HANDLES_SIGPIPE=true
PYTHONPATH=lib:.:..:../..:../lib
USER=dyl
PYTHONIOENCODING=utf-8
HST_FILE=XXX
PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
SHLVL=0
VSCODE_CWD=/u/dyl
XDG_SESSION_ID=2
XDG_RUNTIME_DIR=/run/user/215948
PS1=(qa1-py3.10)
SSH_CLIENT=XXX
PYENV_ROOT=/u/dyl/.pyenv
SUBSCRIPTION_ID=XXX
BROWSER=/u/dyl/.vscode-server/bin/1a5daa3a0231a0fbba4f14db7ec463cf99d7768e/bin/helpers/browser.sh
PATH=/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/bin:/u/dyl/.pyenv/shims:/u/dyl/.pyenv/bin:/u/dyl/.vscode-server/bin/1a5daa3a0231a0fbba4f14db7ec463cf99d7768e/bin/remote-cli:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/u/dyl/.local/bin:/u/dyl/bin:.:/u/dyl/.local/bin:/u/dyl/bin:.:/u/dyl/.local/bin
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/215948/bus
VSCODE_NLS_CONFIG={"locale":"en","osLocale":"en","availableLanguages":{}}
LOCATION=XXX
VSCODE_HANDLES_UNCAUGHT_ERRORS=true
VSCODE_IPC_HOOK_CLI=/run/user/215948/vscode-ipc-792c4cb0-941b-47f4-97e6-391bac41f553.sock
_=/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/bin/python
NATI_LOGGER=TRUE
['/u/dyl/repos/projectroot/qaframeworks/qa1/suites', '/u/dyl/repos/projectroot/qaframeworks/qa1/lib/ecs/tests', '/u/dyl/repos/projectroot/qaframeworks/qa1/lib/dms/tests', '/u/dyl/repos/projectroot/qaframeworks/qa1/environ/tests', '/u/dyl/repos/projectroot/qaframeworks/qa1/suites', '/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools', '/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles', '/u/dyl/repos/projectroot/qaframeworks/qa1/lib', '/u/dyl/repos/projectroot/qaframeworks/qa1', '/u/dyl/repos/projectroot/qaframeworks', '/u/dyl/repos/projectroot', '/u/dyl/repos/projectroot/qaframeworks/lib', '/u/dyl/.pyenv/versions/3.10.4/lib/python310.zip', '/u/dyl/.pyenv/versions/3.10.4/lib/python3.10', '/u/dyl/.pyenv/versions/3.10.4/lib/python3.10/lib-dynload', '/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages', '/u/dyl/repos/projectroot/qaframeworks/lib/k8smanage/../']
The Python extension has run into an unexpected situation
while processing a pytest node during test discovery. Please
Please open an issue at:
https://github.com/microsoft/vscode-python/issues
and paste the following output there.
nodeid:
extra info:
fileid:
traceback:
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/run_adapter.py", line 22, in <module>
main(tool, cmd, subargs, toolargs)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/__main__.py", line 99, in main
parents, result = run(toolargs, **subargs)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 30, in discover
ec = _pytest_main(pytestargs, [_plugin])
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 169, in main
ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
res = hook_impl.function(*args)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 318, in pytest_cmdline_main
return wrap_session(config, _main)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 271, in wrap_session
session.exitstatus = doit(config, session) or 0
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 324, in _main
config.hook.pytest_collection(session=session)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
res = hook_impl.function(*args)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 335, in pytest_collection
session.perform_collect()
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 678, in perform_collect
hook.pytest_collection_modifyitems(
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
res = hook_impl.function(*args)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 95, in pytest_collection_modifyitems
test, parents = self.parse_item(item)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 80, in parse_item
return parse_item(item)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 166, in parse_item
(parentid, parents, fileid, testfunc, _) = _parse_node_id(
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 144, in <lambda>
_parse_node_id=(lambda *a: _parse_node_id(*a)),
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 396, in _parse_node_id
testid, name, kind = next(nodes)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 460, in _iter_nodes
nodeid, testid = _normalize_test_id(testid, kind)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 455, in <lambda>
_normalize_test_id=(lambda *a: _normalize_test_id(*a)),
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 526, in _normalize_test_id
raise should_never_reach_here(
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 132, in should_never_reach_here
traceback.print_stack()
collected 177 items
LARGE LIST OF DISCOVERED TEST MODULES, CLASSES, AND FUNCTIONS GOES HERE
The Python extension has run into an unexpected situation
while processing a pytest node during test discovery. Please
Please open an issue at:
https://github.com/microsoft/vscode-python/issues
and paste the following output there.
nodeid:
extra info:
fileid:
traceback:
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/run_adapter.py", line 22, in <module>
main(tool, cmd, subargs, toolargs)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/__main__.py", line 99, in main
parents, result = run(toolargs, **subargs)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 30, in discover
ec = _pytest_main(pytestargs, [_plugin])
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 169, in main
ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
res = hook_impl.function(*args)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 318, in pytest_cmdline_main
return wrap_session(config, _main)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 271, in wrap_session
session.exitstatus = doit(config, session) or 0
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 324, in _main
config.hook.pytest_collection(session=session)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
res = hook_impl.function(*args)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 335, in pytest_collection
session.perform_collect()
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 682, in perform_collect
hook.pytest_collection_finish(session=self)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
res = hook_impl.function(*args)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 110, in pytest_collection_finish
test, parents = self.parse_item(item)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 80, in parse_item
return parse_item(item)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 166, in parse_item
(parentid, parents, fileid, testfunc, _) = _parse_node_id(
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 144, in <lambda>
_parse_node_id=(lambda *a: _parse_node_id(*a)),
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 396, in _parse_node_id
testid, name, kind = next(nodes)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 460, in _iter_nodes
nodeid, testid = _normalize_test_id(testid, kind)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 455, in <lambda>
_normalize_test_id=(lambda *a: _normalize_test_id(*a)),
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 526, in _normalize_test_id
raise should_never_reach_here(
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 132, in should_never_reach_here
traceback.print_stack()
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 678, in perform_collect
INTERNALERROR> hook.pytest_collection_modifyitems(
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR> return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 152, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_result.py", line 114, in get_result
INTERNALERROR> raise exc.with_traceback(exc.__traceback__)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 95, in pytest_collection_modifyitems
INTERNALERROR> test, parents = self.parse_item(item)
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 80, in parse_item
INTERNALERROR> return parse_item(item)
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 166, in parse_item
INTERNALERROR> (parentid, parents, fileid, testfunc, _) = _parse_node_id(
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 144, in <lambda>
INTERNALERROR> _parse_node_id=(lambda *a: _parse_node_id(*a)),
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 396, in _parse_node_id
INTERNALERROR> testid, name, kind = next(nodes)
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 460, in _iter_nodes
INTERNALERROR> nodeid, testid = _normalize_test_id(testid, kind)
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 455, in <lambda>
INTERNALERROR> _normalize_test_id=(lambda *a: _normalize_test_id(*a)),
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 526, in _normalize_test_id
INTERNALERROR> raise should_never_reach_here(
INTERNALERROR> NotImplementedError: Unexpected pytest node (see printed output).
INTERNALERROR>
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 271, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 324, in _main
INTERNALERROR> config.hook.pytest_collection(session=session)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR> return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 152, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_result.py", line 114, in get_result
INTERNALERROR> raise exc.with_traceback(exc.__traceback__)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 335, in pytest_collection
INTERNALERROR> session.perform_collect()
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/_pytest/main.py", line 682, in perform_collect
INTERNALERROR> hook.pytest_collection_finish(session=self)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
INTERNALERROR> return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 113, in _multicall
INTERNALERROR> raise exception.with_traceback(exception.__traceback__)
INTERNALERROR> File "/u/dyl/repos/projectroot/qaframeworks/qa1/.venv/lib/python3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 110, in pytest_collection_finish
INTERNALERROR> test, parents = self.parse_item(item)
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 80, in parse_item
INTERNALERROR> return parse_item(item)
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 166, in parse_item
INTERNALERROR> (parentid, parents, fileid, testfunc, _) = _parse_node_id(
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 144, in <lambda>
INTERNALERROR> _parse_node_id=(lambda *a: _parse_node_id(*a)),
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 396, in _parse_node_id
INTERNALERROR> testid, name, kind = next(nodes)
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 460, in _iter_nodes
INTERNALERROR> nodeid, testid = _normalize_test_id(testid, kind)
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 455, in <lambda>
INTERNALERROR> _normalize_test_id=(lambda *a: _normalize_test_id(*a)),
INTERNALERROR> File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 526, in _normalize_test_id
INTERNALERROR> raise should_never_reach_here(
INTERNALERROR> NotImplementedError: Unexpected pytest node (see printed output).
========================= 177 tests collected in 2.31s =========================
Traceback (most recent call last):
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/run_adapter.py", line 22, in <module>
main(tool, cmd, subargs, toolargs)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/__main__.py", line 99, in main
parents, result = run(toolargs, **subargs)
File "/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 47, in discover
raise Exception("pytest discovery failed (exit code {})".format(ec))
Exception: pytest discovery failed (exit code 3)
at ChildProcess.<anonymous> (/u/dyl/.vscode-server/extensions/ms-python.python-2023.20.0/out/client/extension.js:2:229869)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5)]
``` </div>
Activity
eleanorjboyd commentedon Nov 27, 2023
hi dylan-at-na, I am going to look into this shortly. Thanks for bringing this up!
eleanorjboyd commentedon Nov 27, 2023
Hello! It looks like you might not be on the new rewrite of testing. Could you try it there? To try it yourself, you need add this setting to your users
settings.json"python.experiments.optInto": ["pythonTestAdapter"].You can confirm you have the rewrite enabled by setting your log level to "trace" via the command palette and then check for
Experiment 'pythonTestAdapter'is active in your python logs.Let me know if the rewrite fixes your issue. Thanks!
floriandeboissieu commentedon Dec 11, 2023
Same error here. After a bunch of hours I finally figured out that it was due to the fact that I opened the project from a symlink directory... a recurrent issue in vscode: https://github.com/search?q=repo%3Amicrosoft%2Fvscode%20symlink&type=issues
eleanorjboyd commentedon Dec 18, 2023
dylan-at-na, are you using symlinks?
As a note on symlinks I created this issue to consolidate bug reporting related to it: #22658. I have a potential fix but it will need extra time as it is more complicated than originally intended.
eleanorjboyd commentedon Dec 18, 2023
Hello! I have put together a detailed problem report and proposed solution for symlinks. Please check it out here and contribute any thoughts you may have: #22658
github-actions commentedon Jan 18, 2024
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.
Happy Coding!
brettcannon commentedon Feb 22, 2024
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.