branch: externals/org
commit 12457bc3587e9682fd714e889e44ce7af5cba26f
Author: Morgan Smith <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    * testing/lisp/test-org-agenda.el: Isolate test errors
    
    If a test failed, it would not perform the cleanup which would cause
    all subsequent tests to fail.
    
    * testing/lisp/test-org-agenda.el (org-test-agenda-with-agenda): Use
    unwind-protect to ensure cleanup happens.
---
 testing/lisp/test-org-agenda.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el
index fb6dd33422..36da85fc01 100644
--- a/testing/lisp/test-org-agenda.el
+++ b/testing/lisp/test-org-agenda.el
@@ -46,8 +46,10 @@
   (declare (indent 1))
   `(org-test-with-temp-text-in-file ,text
      (let ((org-agenda-files `(,buffer-file-name)))
-       ,@body
-       (org-test-agenda--kill-all-agendas))))
+       (unwind-protect
+           (progn
+             ,@body)
+         (org-test-agenda--kill-all-agendas)))))
 
 
 ;; Test the Agenda

Reply via email to