From 66db3f976475a9ee86a78d6b23390b3dc670a470 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 31 Oct 2021 16:21:33 +0530 Subject: [PATCH] Also sanitize various XDG* env vars when running the test suite --- test.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test.py b/test.py index d0ed8df9b..bad48976c 100755 --- a/test.py +++ b/test.py @@ -33,7 +33,13 @@ def init_env() -> None: def main() -> None: warnings.simplefilter('error') - with TemporaryDirectory() as tdir, env_vars(PYTHONWARNINGS='error', HOME=tdir, USERPROFILE=tdir): + with TemporaryDirectory() as tdir, env_vars( + PYTHONWARNINGS='error', HOME=tdir, USERPROFILE=tdir, + XDG_CONFIG_HOME=os.path.join(tdir, '.config'), + XDG_CONFIG_DIRS=os.path.join(tdir, '.config'), + XDG_DATA_DIRS=os.path.join(tdir, '.local', 'xdg'), + XDG_CACHE_HOME=os.path.join(tdir, '.cache'), + ): init_env() m = importlib.import_module('kitty_tests.main') m.run_tests() # type: ignore