From edb2f8bb392c52e2c94d0e676fe1a3e47680f23b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Sat, 9 Nov 2024 22:48:10 +0100 Subject: [PATCH] test: create fake etc/apt/preferences.d to silence test warnings Apt expects the /etc/apt/preferences.d so create it in the fakeroot dirs for the tests to silence the apt warning visible in pytest. --- test/test_base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_base.py b/test/test_base.py index 1e70a3e4..a9e6f706 100644 --- a/test/test_base.py +++ b/test/test_base.py @@ -65,6 +65,8 @@ def make_fake_aptroot(self, template=None, fake_pkgs=[]): self.addCleanup(shutil.rmtree, tmpdir) aptroot = os.path.join(tmpdir, "aptroot") shutil.copytree(template, aptroot) + # apt warns if this dir does not exist + os.makedirs(os.path.join(aptroot, "etc/apt/preferences.d")) # fake dpkg status mock_dpkg_status = os.path.join(aptroot, "var/lib/dpkg/status") with open(mock_dpkg_status, "a") as fp: