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

Pytest at point runs all all tests in module. Must edit and eval template for each test function. #817

Open
RidaAyed opened this issue Nov 29, 2024 · 0 comments

Comments

@RidaAyed
Copy link

For every test function I'm required to edit and evaluate the lisp template.
Otherwise every test in the current module (e.g test.py) is ran from top.

e.g. In order to debug test_foo I'm required to change the value of :args to "-k test_foo"

How can I test at point?

(dap-register-debug-template
  ""
  (list :name "test_func_under_cursor"
        :type "python"
        :args "-k test_foo"
        :cwd "${workspaceFolder}"
        :program nil
        :module "pytest"
        :request "launch"))

test.py

def test_foo():
    assert True

def test_bar():
    assert True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant