Skip to content

I also have "Test discovery failed" after upgraded to 2019.6.22090 #6463

Closed
@karrtikr

Description

@karrtikr

I also have "Test discovery failed" after upgraded to 2019.6.22090

VS Code version: 1.36.0
Extension version (available under the Extensions sidebar): 2019.6.22090
OS and version: Linux
Python version (& distribution if applicable, e.g. Anaconda): 3.6.5
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
Relevant/affected Python packages and their versions: pytest - 3.2.1
Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info #3977): False

in my case I have the following trace:

python ..../.vscode-server/extensions/ms-python.python-2019.6.22090/pythonFiles/testing_tools/run_adapter.py discover pytest -- -s --cache-clear
Traceback (most recent call last):
  File ".../lib/python3.6/site-packages/_pytest/main.py", line 648, in perform_collect
    config=self.config, items=items)
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
    res = hook_impl.function(*args)
  File "..../.vscode-server/extensions/ms-python.python-2019.6.22090/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 76, in pytest_collection_modifyitems
    test, parents = parse_item(item, self.NORMCASE, self.PATHSEP)
  File "..../.vscode-server/extensions/ms-python.python-2019.6.22090/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 191, in parse_item
    for marker in item.own_markers:
AttributeError: 'Function' object has no attribute 'own_markers'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ".../lib/python3.6/site-packages/_pytest/main.py", line 110, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File ".../lib/python3.6/site-packages/_pytest/main.py", line 145, in _main
    config.hook.pytest_collection(session=session)
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
    res = hook_impl.function(*args)
  File ".../lib/python3.6/site-packages/_pytest/main.py", line 155, in pytest_collection
    return session.perform_collect()
  File ".../lib/python3.6/site-packages/_pytest/main.py", line 650, in perform_collect
    hook.pytest_collection_finish(session=self)
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File ".../lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
    res = hook_impl.function(*args)
  File "..../.vscode-server/extensions/ms-python.python-2019.6.22090/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 90, in pytest_collection_finish
    test, parents = parse_item(item, self.NORMCASE, self.PATHSEP)
  File "..../.vscode-server/extensions/ms-python.python-2019.6.22090/pythonFiles/testing_tools/adapter/pytest/_pytest_item.py", line 191, in parse_item
    for marker in item.own_markers:
AttributeError: 'Function' object has no attribute 'own_markers'

Platform:

platform linux -- Python 3.6.5, pytest-3.2.1, py-1.4.34, pluggy-0.4.0 

I confirm that with Extension version 2019.5.18875, (all other things the same) it discovers my tests and run/debug pytest just fine.

Originally posted by @aminfara in #6417 (comment)

Metadata

Metadata

Labels

area-testingbugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priorityregressionBug didn't exist in a previous release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions