Function: projectile-test-at-point-python-name

projectile-test-at-point-python-name is a byte-compiled function defined in projectile.el.

Signature

(projectile-test-at-point-python-name NODE)

Documentation

Return the test name for the Python function_definition NODE.

Return nil unless the function's name starts with "test_".

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260820.1509/projectile.el
;;; Running the test at point
;;
;; Run just the test the cursor is in, rather than the whole suite.  A rule
;; per major mode says how to recognise a test in that language's syntax
;; tree and how to name it on the command line; `projectile-test-at-point-rules'
;; ties them together and is where a language gets added.


(defun projectile-test-at-point-python-name (node)
  "Return the test name for the Python `function_definition' NODE.
Return nil unless the function's name starts with \"test_\"."
  (when-let* ((name-node (treesit-node-child-by-field-name node "name"))
              (name (treesit-node-text name-node t)))
    (when (string-prefix-p "test_" name)
      name)))