Skip to content

Code lens not present overtop test code when using PyTest >= 3.7 #2347

@MartinWallgren

Description

@MartinWallgren

It is not possible to run/debug single tests from vscode if the project is using pytest version 3.7.0 or 3.7.1. Pytest 3.6.4 can run and discover tests without issues.

Environment data

  • VS Code version: 1.25.1
  • Extension version (available under the Extensions sidebar): 2018.7.1
  • OS and version: Linux Debian GNU/Linux 9 (stretch)
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.5
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pyenv
  • Relevant/affected Python packages and their versions: pytest 3.7.0, 3.7.1

Actual behavior

Python: Discover Unit Test does not annotate any test cases with the Run Test | Debug Test annotation.
Python: Run Unit Test Method results in "No tests ran..."

If I downgrade pytest to 3.6.4 vs code does not have these issues.

Expected behavior

Python: Discover Unit Test should annotate any test cases with the Run Test | Debug Test annotation.
It should be possible to run/debug single tests.

Steps to reproduce:

  1. Setup a project with pytest 3.7.0
  2. Issue the command Python: Run Unit Test Method

Logs

========================= no tests ran in 0.29 seconds =========================
============================= test session starts ==============================
platform linux -- Python 3.6.5, pytest-3.7.1, py-1.5.4, pluggy-0.7.1
rootdir: /home/martinwa/wd/platformci/reactor/src, inifile:
plugins: tmpelasticsearch-0.1.2, pylint-0.11.0, flake8-1.0.1, datadir-ng-1.1.0, cov-2.5.1

-------------- generated xml file: /tmp/tmp-19448low3Z4aSmvDT.xml --------------
========================= no tests ran in 0.00 seconds =========================
ERROR: file not found: test_api_utils.py::test_add_state_filter_noq_0states

Metadata

Metadata

Assignees

Labels

area-testingbugIssue identified by VS Code Team member as probable bugimportantIssue identified as high-priority

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions