Skip to content

Code lenses for tests not showing up when test is defined on line 1 #3062

Closed

Description

def test_fake():
    return True

Debug console output:

============================= test session starts =============================
platform win32 -- Python 3.7.0, pytest-3.7.4, py-1.6.0, pluggy-0.7.1
rootdir: c:\Users\brcan\Desktop\testing\some 3.7 bunk, inifile:
collected 1 item
<Module 'test_fake.py'>
  <Function 'test_fake'>

======================== no tests ran in 0.03 seconds =========================

Activity

  1. DonJayamanne commented on Oct 31, 2018

    @DonJayamanne

    What's in your settings.json?
    I'm after your pytests settings

  2. brettcannon commented on Oct 31, 2018

    @brettcannon
    MemberAuthor

    Used the test setup flow and chose '.' as the test location.

  3. brettcannon commented on Nov 1, 2018

    @brettcannon
    MemberAuthor
    "python.unitTest.pyTestArgs": [
            "."
        ],
        "python.unitTest.unittestEnabled": false,
        "python.unitTest.nosetestsEnabled": false,
        "python.unitTest.pyTestEnabled": true
  4. brettcannon commented on Nov 1, 2018

    @brettcannon
    MemberAuthor

    Turns out that the code lens will show up as long as the test definition does not start on line 1.

  5. brettcannon commented on Nov 1, 2018

    @brettcannon
    MemberAuthor

    image

    image

  6. changed the title [-]Code lenses for tests not showing up for pytest[/-] [+]Code lenses for tests not showing up when test is defined on line 1[/+] on Nov 1, 2018
  7. kimadeline commented on Jul 29, 2021

    @kimadeline

    Fixed by #16769, we don't have code lenses anymore, and the new test icons show up even if the test is defined on the first line:

    image

  8. locked as resolved and limited conversation to collaborators on Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-testingbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions