branch: externals/modus-themes
commit b633768b7ce7aa40cc06070f9b8fc1f7219d102d
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    Rewrite mtt-inheritance test to restore the current Modus theme
---
 tests/modus-themes-test.el | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/tests/modus-themes-test.el b/tests/modus-themes-test.el
index c533b9d377..820d8ca13a 100644
--- a/tests/modus-themes-test.el
+++ b/tests/modus-themes-test.el
@@ -39,16 +39,21 @@
   "Ensure all faces inherit from valid faces."
   ;; Third-party packages, loaded if possible to better test face inheritance.
   (require 'font-latex nil t)
-  (modus-themes-select 'modus-operandi)
-  (should-not (seq-filter
-               (lambda (face)
-                 ;; The face either has no parent ...
-                 (if-let* ((parent (face-attribute face :inherit)))
-                     (and (symbolp parent)
-                          (not (eq parent 'unspecified))
-                          ;; ... or its parent is a valid face.
-                          (not (facep parent)))))
-               (face-list))))
+  (let ((current-theme (modus-themes-get-current-theme)))
+    (unwind-protect
+        (progn
+          (modus-themes-load-theme 'modus-operandi)
+          (should-not (seq-filter
+                       (lambda (face)
+                         ;; The face either has no parent ...
+                         (if-let* ((parent (face-attribute face :inherit)))
+                             (and (symbolp parent)
+                                  (not (eq parent 'unspecified))
+                                  ;; ... or its parent is a valid face.
+                                  (not (facep parent)))))
+                       (face-list))))
+      (modus-themes-load-theme current-theme))))
+
 
 (provide 'modus-themes-test)
 ;;; modus-themes-test.el ends here

Reply via email to