Skip to content

Without code lenses after running "Run All Unit Tests". #9326

@linette-zyy

Description

@linette-zyy

Environment data

  • VS Code version: 1.42.0-insider
  • Extension version: 2020.1.56281-dev

Steps to reproduce:

  1. Launch VSC and create python file named unit_test.py in folder1
    a. Clear the part of workspace configuration in setting.json
  2. Enter below code:
import unittest

class PassingTests(unittest.TestCase):
    def test_passing(self):
        self.assertEqual(42, 42)
    def test_passing_still(self):
        self.assertEqual("silly walk", "silly walk")

class FailingTests(unittest.TestCase):
    def test_failure(self):
        self.assertEqual(42, -13)
    def test_failure_still(self):
        self.assertEqual("I'm right!", "no, I am!")    
  1. Repeat step1,2 but in folder2
  2. Run "Run All Unit Tests", ensure:
    a. triggers the prompt to configure the test runner
    a). Click "Enable and configure a test framework"
    b). Select "Unittest" and next ". Root directory"
    c). Select first test file name format

Expected behavior

Tests are discovered (as shown by code lenses on each test)
image

Actual behavior

Without code lenses.
image

This issue reproduced on Python2.7, Python3.7 and Anaconda environments.

Metadata

Metadata

Assignees

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