From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
Date: Wed, 18 Oct 2023 11:58:46 +0200
Subject: Use pristine home directory for Python tests

---
 test/test_build_python.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/test_build_python.py b/test/test_build_python.py
index 7780a56..89092b8 100644
--- a/test/test_build_python.py
+++ b/test/test_build_python.py
@@ -3,6 +3,7 @@
 
 import asyncio
 from contextlib import suppress
+import os
 from pathlib import Path
 from tempfile import TemporaryDirectory
 from types import SimpleNamespace
@@ -58,6 +59,9 @@ def _test_build_package(
     asyncio.set_event_loop(event_loop)
     try:
         tmp_path = Path(tmp_path_str)
+        home_path = tmp_path / "fake_home"
+        home_path.mkdir(exist_ok=True)
+        os.environ["HOME"] = str(home_path)
         python_build_task = PythonBuildTask()
         package = PackageDescriptor(tmp_path / 'src')
         package.name = 'test-package'
