Skip to content

Test ERROR: File Not Found Error #8222

Closed

Description

Environment data

  • VS Code version: 1.39.2 (user setup)
  • Extension version (available under the Extensions sidebar): 2019.10.44104
  • OS and version: Windows_NT x64 10.0.18363
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv
  • Relevant/affected Python packages and their versions: pytest

Expected behaviour

Pytest Tests work.

Actual behaviour

If I set the top level directory for the Python Test extension to azure-iot-device for pytest, the python extension will be able to discover tests without erroring out, but upon debugging I will get an Error:

ERROR: file not found: ./azure-iot-device/tests/common/pipeline/test_pipeline_stages_base.py::TestEnsureConnectionStageUnknownEvents::test_uses_background_exception_handler[IncomingMQTTMessageEvent]

The issue is that error is cryptic. Running tests in the command prompt there is no error as such. Where is the error coming from? is it from generated code? How to i fix it?

Logs

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

https://gist.github.com/YoDaMa/9b25b078cf4e262ab61f275537bfb37f

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)

============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-5.2.1, py-1.8.0, pluggy-0.13.0
rootdir: e:\GitRepos\Python\custom_user_agent, inifile: pytest.ini
plugins: asyncio-0.10.0, cov-2.8.1, mock-1.10.4, testdox-1.2.0, timeout-1.3.3
timeout: 20.0s
timeout method: thread
timeout func_only: False
collected 0 items

- generated xml file: C:\Users\yomaguir\AppData\Local\Temp\tmp-12232X4OzggdFWp6w.xml -
============================ no tests ran in 0.09s ============================
ERROR: file not found: ./azure-iot-device/tests/common/pipeline/test_pipeline_stages_base.py::TestEnsureConnectionStageUnknownEvents::test_uses_background_exception_handler[IncomingMQTTMessageEvent]

Activity

  1. added
    triage-neededNeeds assignment to the proper sub-team
    bugIssue identified by VS Code Team member as probable bug
    on Oct 25, 2019
  2. brettcannon commented on Oct 28, 2019

    @brettcannon
    Member

    Are you using just the Python extension for VS Code or do you have another Python extension installed (your comment about the "Python Test extension" suggests you have more than one). If you have another Python extension then please disable the other ones to make sure they are not interfering with our extension.

    And when you said "running tests in the command prompt there is no error", is that with the same command the extension uses to execute your tests (which you can see in the Output panel), or are you creating the command yourself? If the latter, please try using the command we use to see if it reproduces the problem.

  3. YoDaMa commented on Oct 28, 2019

    @YoDaMa
    Author

    Specifically the Python Extension for VS Code.

    image

  4. YoDaMa commented on Oct 28, 2019

    @YoDaMa
    Author

    Brett Cannon (@brettcannon) it's not clear from the logs what specifically the extension is running so I can repro what you are asking. I've included my OUTPUT as a gist above. Can you point me at the line I can paste into my own command prompt to run?

    That being said, I'm running pyest in my top level folder, which is generic, and generally how you run pytest tests... As in literally:

    $ cd azure-iot-sdk-python/azure-iot-device
    $ pytest
    
  5. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Oct 28, 2019
  6. brettcannon commented on Oct 28, 2019

    @brettcannon
    Member

    Yoseph Maguire (@YoDaMa) I thought we printed the lint in the Output panel for each test log run, but if that's not the case then we will have it under the general "Python" tab of the Output panel.

  7. kimadeline commented on Oct 28, 2019

    @kimadeline

    Hi Yoseph Maguire (@YoDaMa) 👋

    Could you also copy here the content of the terminal when you run pytest . from the e:\GitRepos\Python\custom_user_agent folder (it's the rootdir folder in your log snippet above)?

    Thanks!

  8. brettcannon commented on Jan 2, 2020

    @brettcannon
    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.

  9. ghost removed on Jan 2, 2020
  10. locked as resolved and limited conversation to collaborators on Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions