summaryrefslogtreecommitdiff
path: root/tests/test-system-defaults-functions.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-system-defaults-functions.el')
-rw-r--r--tests/test-system-defaults-functions.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test-system-defaults-functions.el b/tests/test-system-defaults-functions.el
index 580e7a7c..154e3678 100644
--- a/tests/test-system-defaults-functions.el
+++ b/tests/test-system-defaults-functions.el
@@ -47,7 +47,12 @@
;; bodies. Stubs deliberately scope only to the require so the
;; real primitives remain available for unrelated tests in the
;; same Emacs.
-(let ((use-package-always-ensure nil))
+;; Contain system-defaults' load-time `(setq default-directory user-home-dir)'
+;; so it doesn't leak into a shared batch session. `make test-name' loads
+;; every test file into one Emacs; a leaked cwd there breaks the relative
+;; loads of every file that follows.
+(let ((default-directory default-directory)
+ (use-package-always-ensure nil))
(cl-letf (((symbol-function 'server-running-p) (lambda (&rest _) t))
((symbol-function 'server-start) #'ignore)
((symbol-function 'set-locale-environment) #'ignore)