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

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

Closed
karrtikr opened this issue Jul 5, 2019 · 6 comments
Closed

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

karrtikr opened this issue Jul 5, 2019 · 6 comments
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority regression Bug didn't exist in a previous release

Comments

@karrtikr
Copy link

karrtikr commented Jul 5, 2019

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)

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Jul 5, 2019
@DonJayamanne DonJayamanne added area-testing bug Issue identified by VS Code Team member as probable bug needs PR labels Jul 8, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jul 8, 2019
@DonJayamanne DonJayamanne added the important Issue identified as high-priority label Jul 8, 2019
@defaul
Copy link

defaul commented Jul 8, 2019

Same issue. I was trying different versions of pytest and downgrade the python extension without success.

@AnneTheAgile
Copy link

I get test discovery failed alot when I have even a tiny syntax error, eg I think just change spacing where should be 4 to 2.

@rdrey
Copy link

rdrey commented Jul 9, 2019

I have fixed this locally with getattr(item, 'own_markers', []) for Functions and TestCaseFunctions. Will create a tiny PR to fix it and work on some regression tests to add after work.

@rdrey
Copy link

rdrey commented Jul 11, 2019

Sorry, haven't had time to add some new unit tests for this yet.

@ericsnowcurrently
Copy link
Member

The fix needs to be validated.

@DonJayamanne DonJayamanne added regression Bug didn't exist in a previous release and removed reason-new feature labels Jul 27, 2019
@DonJayamanne DonJayamanne self-assigned this Jul 30, 2019
@karrtikr
Copy link
Author

karrtikr commented Aug 5, 2019

validated

@karrtikr karrtikr closed this as completed Aug 5, 2019
@ghost ghost removed the needs PR label Aug 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority regression Bug didn't exist in a previous release
Projects
None yet
Development

No branches or pull requests

6 participants