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

Test runner appears to not respect the selected interpreter setting #7215

Closed
stereobutter opened this issue Sep 5, 2019 · 7 comments
Closed
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@stereobutter
Copy link

Extension version: 2019.9.34474
VS Code version: Code 1.38.0 (3db7e09f3b61f915d03bbfa58e258d6eee843f35, 2019-09-03T21:47:00.464Z)
OS version: Darwin x64 18.6.0


In settings.json I selected an interpreter (that has some additional dependencies for pytest installed) via "python.pythonPath". When I run pytest tests from the terminal (with the appropriate interpreter activated) my tests run fine, while the test runner complains

"Test discovery error, please check the configuration settings for the tests."

due to some pytest argument error (presumably caused by not finding the proper dependencies)

@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Sep 5, 2019
@stereobutter
Copy link
Author

The issue occurs with a local repo cloned from https://github.com/dry-python/returns where poetry is used to manage dependencies.

@ericsnowcurrently ericsnowcurrently self-assigned this Sep 5, 2019
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Sep 5, 2019
@ericsnowcurrently
Copy link
Member

Hi @SaschaSchlemmer. Thanks for letting us know about this. I have some questions:

  • what Python interpreter do you put in your settings.json?
  • what shows up in the "Python Test Log" output panel?

@ericsnowcurrently ericsnowcurrently added the info-needed Issue requires more information from poster label Sep 6, 2019
@stereobutter
Copy link
Author

stereobutter commented Sep 7, 2019

  • The python interpreter I put into my the workspaces settings.json is
    "/Users/sascha/Library/Caches/pypoetry/virtualenvs/returns-py3.6/bin/python"
  • The Python Test Log says
    Traceback (most recent call last):
      File "/Users/sascha/.vscode/extensions/ms-python.python-2019.9.34474/pythonFiles/testing_tools/run_adapter.py", line 18, in <module>
        main(tool, cmd, subargs, toolargs)
      File "/Users/sascha/.vscode/extensions/ms-python.python-2019.9.34474/pythonFiles/testing_tools/adapter/__main__.py", line 90, in main
        parents, result = run(toolargs, **subargs)
      File "/Users/sascha/.vscode/extensions/ms-python.python-2019.9.34474/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 35, in discover
        raise Exception('pytest discovery failed (exit code {})'.format(ec))
    Exception: pytest discovery failed (exit code 1)
    

@ericsnowcurrently ericsnowcurrently removed the info-needed Issue requires more information from poster label Sep 25, 2019
@ericsnowcurrently
Copy link
Member

@SaschaSchlemmer, sorry for the delay. The "Python test log" output panel should have included more information than that, such as error output from pytest or the test adapter script we use. Please include that output.

Also, what command do you see run for test discovery in the "Python" output panel? It should reflect your "python.pythonPath" setting.

@ericsnowcurrently ericsnowcurrently added the info-needed Issue requires more information from poster label Oct 7, 2019
@LightCC
Copy link

LightCC commented Nov 8, 2019

I may have some additional info. I have Python 3.8 installed, but my Python 3.7 folder/exe is my default (interpretter is selected as Python 3.7.4 64-bit, that is the version in my venv, PY_PYTHON 3.7 and only my python37/Scripts folder on the PATH), yet I keep getting complaints that the extension cannot find pytest, even though it is installed via Python 3.7.

If I click the "pytest is not installed" pop-up "yes" to install pytest, the command is installing pytest using Python 3.8 (and the --user tag).

I cannot figure out why the Python extension is assuming I want it to use Python 3.8 and it's system and/or user directories as the location for pytest.

@ericsnowcurrently ericsnowcurrently removed the info-needed Issue requires more information from poster label Nov 11, 2019
@ericsnowcurrently
Copy link
Member

Thanks for the update. Please answer the following:

  • what is the current "python.pythonPath" setting?
  • do you see that interpreter in the list when you run the "Python: Select Interpreter" command?
  • in the "Python" output panel, what is the command the extension is running for test discovery?
  • what is the full output in the "Python Test Log" output panel?

Thanks!

@ericsnowcurrently ericsnowcurrently added the info-needed Issue requires more information from poster label Nov 11, 2019
@brettcannon
Copy link
Member

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.

@ghost ghost removed the triage label Jan 8, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants