1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-30 10:11:47 -07:00

python-tests.el: Fix test failures introduced by commit c1c08f3c9f

* test/lisp/progmodes/python-tests.el (python-ts-mode-dotted-decorator-face-2)
(python-ts-mode-builtin-call-face)
(python-ts-mode-level-fontification-wo-interpolation)
(python-ts-mode-disabled-string-interpolation): Call `font-lock-ensure`
after setting a var that may flush the font-locking.
This commit is contained in:
Stefan Monnier 2026-03-31 09:45:42 -04:00
parent 38a6b22a6c
commit 8485e49680

View file

@ -8012,6 +8012,7 @@ always located at the beginning of buffer."
def test():"
(setopt treesit-font-lock-level 4)
(font-lock-ensure)
(dolist (test '("pytest" "mark" "skip"))
(search-forward test)
(goto-char (match-beginning 0))
@ -8022,6 +8023,7 @@ always located at the beginning of buffer."
"all()"
;; enable 'function' feature from 4th level
(setopt treesit-font-lock-level 4)
(font-lock-ensure)
(should (eq (face-at-point) 'font-lock-builtin-face))))
(ert-deftest python-ts-mode-interpolation-nested-string ()
@ -8050,6 +8052,7 @@ always located at the beginning of buffer."
"t = f\"beg {True + var}\""
(setopt treesit-font-lock-level 2)
(font-lock-ensure)
(search-forward "f")
(goto-char (match-beginning 0))
(should (not (eq (face-at-point) 'font-lock-string-face)))
@ -8068,6 +8071,7 @@ always located at the beginning of buffer."
(setf (nth 2 treesit-font-lock-feature-list)
(remq 'string-interpolation (nth 2 treesit-font-lock-feature-list)))
(setopt treesit-font-lock-level 3)
(font-lock-ensure)
(search-forward "f")
(goto-char (match-beginning 0))