Skip to content

Unable to open tests folder in file explorer after the test rescan, when using a pytest framework #6554

Closed

Description

Environment data

  • VS Code version: latest release
  • Extension version (available under the Extensions sidebar): latest release
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.4
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): yes
  • Relevant/affected Python packages and their versions: pytest latest release
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info How to update the language server to the latest stable version #3977): no

Expected behaviour

To not be hidden.

Actual behaviour

Hides the tests folder contents
image

Steps to reproduce:

  1. Use a pytest framework in the project.
  2. Rescan the project for tests.

Activity

  1. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Jul 15, 2019
  2. karrtikr commented on Jul 16, 2019

    @karrtikr

    Can you please right click tests directory and select Reveal file in explorer option. If the files are still there, this maybe a VSC issue as we do not control what to show in the test folder contents.

  3. skasch commented on Jul 17, 2019

    @skasch

    I have the same issue.

    I did a couple tests; it looks like when the "Test" tab is open (the one with the erlenmeyer flask) to display the tests tree, this blocks the File Explorer tab from retrieving the files in the tests folder.

    • When reloading VSCode with the tests folder open in the Windows explorer, the tests folder opens correctly in the Explorer tab.
    • However, if I close the folder in the Explorer tab, open the Test tab, and open a test function inside the Test interface,
    • Then comes back to the Explorer tab, then I cannot open the tests folder anymore, and is displayed as if empty by the interface.

    Would that point out to a VSC issue, rather than a Python extension issue?

  4. karrtikr commented on Jul 18, 2019

    @karrtikr

    Romain Mondon Cancel (@skasch) Thanks for dissecting the issue. Unfortunately, I am not able to reproduce the problem with this info. Can you please provide a minimal setup to reproduce it? (i.e with file directory structure, file contents)

    Screenshots and possibly GIF would help.

  5. skasch commented on Jul 19, 2019

    @skasch

    I made a small, reproducible example of a Python project with tests for pytest here: testing_pytest_framework

    Here below are the three steps that lead to the tests folder becoming invisible:

    pytest_framework_1
    pytest_framework_2
    pytest_framework_3

    The problem actually arises whenever we open a test file from the "Test" tab directly.

    EDIT: from the look of the third screenshot, looking at the full path (c:\users...) of the opened test file, it may be VSCode does not recognize that the file is inside the opened folder.

  6. karrtikr commented on Jul 31, 2019

    @karrtikr

    Thanks for the info. The issue will be fixed along with fixing #6758.

  7. removed their assignment
    on Jul 31, 2019
  8. changed the title [-]The tests folder becomes empty after the test rescan, when using a pytest framework[/-] [+]Unable to open tests folder in file explorer after the test rescan, when using a pytest framework[/+] on Jul 31, 2019
  9. karrtikr commented on Jul 31, 2019

    @karrtikr

    Closing in favor of #6758

  10. locked as resolved and limited conversation to collaborators on Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-testingbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions