Skip to content

Commit 81c6569

Browse files
committed
Flymake: unbreak tests
Flymake's normal behaviour implies catching the errors of misbehaving backends. This behavior is tested by Flymake's automated tests, built on top of ERT, which means that debug-on-error is always t in the bodies of said tests (I don't know the rationale for this, but it's been like this for some time) Flymake used to shun usage of 'condition-case-unless-debug' because of this. But since that macro is pretty useful, I started using it again, and as a consequence, tests started breaking. The solution is to: 1. stop requiring the deprecated legacy backend 'flymake-proc' (which by design, always errors, except in rare circumstances). 2. deliberately set debug-on-error to nil around the "dummy backends"" test. * lisp/progmodes/flymake.el (flymake-proc): Don't require it by default. * test/lisp/progmodes/flymake-tests.el: (dummy-backends): Make robust to ert's debug-on-error setting.
1 parent 9b933a6 commit 81c6569

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lisp/progmodes/flymake.el

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,4 @@ some of this variable's contents the diagnostic listings.")
19771977

19781978
(provide 'flymake)
19791979

1980-
(require 'flymake-proc)
1981-
19821980
;;; flymake.el ends here

test/lisp/progmodes/flymake-tests.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ SEVERITY-PREDICATE is used to setup
213213

214214
(ert-deftest dummy-backends ()
215215
"Test many different kinds of backends."
216+
(let ((debug-on-error nil))
216217
(with-temp-buffer
217218
(cl-letf
218219
(((symbol-function 'error-backend)
@@ -291,7 +292,7 @@ SEVERITY-PREDICATE is used to setup
291292
(should (eq 'flymake-warning (face-at-point))) ; dolor
292293
(flymake-goto-next-error)
293294
(should (eq 'flymake-error (face-at-point))) ; prognata
294-
(should-error (flymake-goto-next-error nil nil t))))))
295+
(should-error (flymake-goto-next-error nil nil t)))))))
295296

296297
(ert-deftest recurrent-backend ()
297298
"Test a backend that calls REPORT-FN multiple times."

0 commit comments

Comments
 (0)