Skip to content
Snippets Groups Projects
Commit 687ba50c authored by Thomas Kluyver's avatar Thomas Kluyver Committed by Karim Ahmed
Browse files

Skip permission test when run as root

parent 95595580
No related branches found
No related tags found
1 merge request!984Try updating to Python 3.11 & update all deps
import os
import datetime as dt import datetime as dt
import logging import logging
import sys import sys
...@@ -62,6 +64,9 @@ def test_check_files(tmp_path): ...@@ -62,6 +64,9 @@ def test_check_files(tmp_path):
runs = [1, 2] runs = [1, 2]
assert not check_files(in_folder, runs, karabo_das) 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 = tmp_path / "noaccess"
noaccess.mkdir(mode=0o000) # make a directory we can't read noaccess.mkdir(mode=0o000) # make a directory we can't read
with pytest.raises(PermissionError): with pytest.raises(PermissionError):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment