Skip to content

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

Open
@RidaAyed

Description

@RidaAyed

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions