Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
brettcannon opened this issue Oct 30, 2018 · 6 comments · Fixed by #16769
Closed

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

brettcannon opened this issue Oct 30, 2018 · 6 comments · Fixed by #16769
Labels
area-testing bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@brettcannon
Copy link
Member

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 =========================
@brettcannon brettcannon added bug Issue identified by VS Code Team member as probable bug needs PR area-testing labels Oct 30, 2018
@DonJayamanne
Copy link

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

@DonJayamanne DonJayamanne self-assigned this Oct 31, 2018
@brettcannon
Copy link
Member Author

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

@brettcannon
Copy link
Member Author

"python.unitTest.pyTestArgs": [
        "."
    ],
    "python.unitTest.unittestEnabled": false,
    "python.unitTest.nosetestsEnabled": false,
    "python.unitTest.pyTestEnabled": true

@brettcannon
Copy link
Member Author

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

@brettcannon
Copy link
Member Author

image

image

@brettcannon brettcannon 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 Nov 1, 2018
@kimadeline
Copy link

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

@kimadeline kimadeline added the verified Verification succeeded label Jul 29, 2021
@karthiknadig karthiknadig added this to the August 2021 milestone Aug 5, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants