Skip to content

Pytest discovery error suggests installing pytest #6671

@wouterdebie

Description

@wouterdebie

Environment data

  • VS Code version: 1.36.1 (1.36.1)
  • Extension version (available under the Extensions sidebar): 2019.6.24221
  • OS and version: macOS 10.15.5
  • Python version (& distribution if applicable, e.g. Anaconda): Python 2.7.16 (64-bit)
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): virtualenv
  • Relevant/affected Python packages and their versions: pytest
  • 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): LS

Expected behaviour

When an error occurs during discovering tests (like a syntax error, missing dependencies, etc), VS code should warn me that importing tests failed because of an error in the code.

Actual behaviour

When an error occurs during discovering tests (like a syntax error, missing deps, etc), VS code assumes it's because pytest isn't installed:

image

This can be misleading, since pytest is actually installed and the cause of the failure lies somewhere else.

Steps to reproduce:

  1. Have working tests
  2. Import a module in tests (or code under test) that doesn't exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue 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