From 687ba50c4d9f58fe882c8cb440a2051560e314bd Mon Sep 17 00:00:00 2001 From: Thomas Kluyver <thomas.kluyver@xfel.eu> Date: Tue, 9 Jul 2024 14:08:35 +0100 Subject: [PATCH] Skip permission test when run as root --- tests/test_webservice.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_webservice.py b/tests/test_webservice.py index 74d9d8e0b..30c3606cd 100644 --- a/tests/test_webservice.py +++ b/tests/test_webservice.py @@ -1,3 +1,5 @@ +import os + import datetime as dt import logging import sys @@ -62,6 +64,9 @@ def test_check_files(tmp_path): runs = [1, 2] assert not check_files(in_folder, runs, karabo_das) + if os.getuid() == 0: + return # root can bypass access permissions, so the test below doesn't work + noaccess = tmp_path / "noaccess" noaccess.mkdir(mode=0o000) # make a directory we can't read with pytest.raises(PermissionError): -- GitLab