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

Command/shortcut for running/debugging test under cursor #637

Closed
slint opened this Issue Jan 26, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@slint
Copy link

slint commented Jan 26, 2018

It would be nice to have a command for running/debugging the test in which the cursor is placed inside. Example:

def test_something():
    x = 1  # With cursor here, running "Python: Debug Current Test" would debug only this test
    y = 2  # breakpoint here
    assert (x + y) == 3

In case of "multiple" tests the specific test case selection dropdown would appear for selection.

@DonJayamanne

This comment has been minimized.

Copy link

DonJayamanne commented Jan 26, 2018

A code lenses appears above the test method, which would allow you to do exactly what you have asked for.
Please however your mouse over the test method name to get the code lens.

@slint

This comment has been minimized.

Copy link

slint commented Jan 26, 2018

Indeed there is a code lens above the function, though it requires using the mouse to run it. I assumed that if it is easy to detect the current method/function from the position of the cursor inside it, it would be easy to run/debug the current test through a Python: Debug Current Test command which could be mapped to a keyboard shortcut eventually.

(If this is something that you're ok with from a feature POV, I wouldn't mind jumping in and contributing the command to the package myself 😉)

@brettcannon

This comment has been minimized.

Copy link
Member

brettcannon commented Apr 12, 2018

@slint if you're willing to provide a PR we would be willing to review it.

@brettcannon

This comment has been minimized.

Copy link
Member

brettcannon commented Sep 20, 2018

To help manage our issues and to better communicate what the team plans to work on we are closing issues that we don't plan to work on but would accept a pull request from a volunteer for. To be clear, closing this issue does not mean we won't consider a pull request for this enhancement as outlined in our contributing guide, just that the development team has no plans to work on it themselves.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.