Bypass test_mkdir_with_permission if root

This commit is contained in:
Alexandre Aubin 2020-04-02 01:30:20 +02:00
parent 4dd1f31ce6
commit 78f37782ae

View file

@ -371,6 +371,12 @@ def test_mkdir(tmp_path):
def test_mkdir_with_permission(tmp_path, mocker): def test_mkdir_with_permission(tmp_path, mocker):
# This test only make sense when not being root
import pdb; pdb.set_trace()
if os.getuid() == 0:
return
new_path = tmp_path / "new_folder" new_path = tmp_path / "new_folder"
permission = 0o700 permission = 0o700
mkdir(str(new_path), mode=permission) mkdir(str(new_path), mode=permission)