dap-mode icon indicating copy to clipboard operation
dap-mode copied to clipboard

debugpy passes breakpoints when used with pytest module

Open johannes-mueller opened this issue 3 years ago • 0 comments

When I am using debugpy with a template that has :module "pytest", breakpoints that I am setting with dap-mode are ignored. When I am using a template with :module nil it works.

When I set breakpoints into the code with breakpoint() it also works with :module "pytest"

This is my template:

(defun dap-python-johmue-populate-test-at-point (conf)
  "Populate CONF with the required arguments."
  (if-let ((test (test-cockpit--python--test-function-path)))
      (plist-put conf :program test)
    (user-error "`dap-python': no test at point"))
  (plist-put conf :cwd (lsp-workspace-root))
  (dap-python--populate-start-file-args conf))

(dap-register-debug-provider "python-test-at-point" 'dap-python-johmue-populate-test-at-point)
(dap-register-debug-template "Python :: Run pytest (at point)"
                             (list :type "python-test-at-point"
                                   :args ""
                                   :program nil
                                   :module "pytest"
                                   :request "launch"
                                   :name "Python :: Run pytest (at point)"))

johannes-mueller avatar Jun 13 '21 14:06 johannes-mueller