Skip to content

Commit 5690327

Browse files
author
André Lange
committed
test(doctor): skip chmod-unreadable test as root too (Forgejo CI runs as root)
The Forgejo runner executes jobs as root, which bypasses chmod 0o000 — the file stays readable so _check_config_file_paths reports passed=True and the test's 'assert passed is False' fails. Extend the existing Windows skipif to also skip when euid==0 (same rationale: chmod-based unreadability has no effect). 711/712 already green on Forgejo; this makes it 712.
1 parent a3536d0 commit 5690327

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tests/test_doctor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Tests for `cap doctor` command including deep checks."""
22

33
import json
4+
import os
45
import sys
56
import tempfile
67
from pathlib import Path
@@ -100,8 +101,8 @@ def test_config_file_paths_no_configs(self, tmp_home, monkeypatch):
100101
assert name == "Config file paths"
101102
assert passed is True
102103

103-
@pytest.mark.skipif(sys.platform == "win32",
104-
reason="chmod-based unreadability has no Windows equivalent")
104+
@pytest.mark.skipif(sys.platform == "win32" or (hasattr(os, "geteuid") and os.geteuid() == 0),
105+
reason="chmod-based unreadability has no effect on Windows or as root (CI)")
105106
def test_config_file_paths_unreadable(self, tmp_home, monkeypatch):
106107
cf = tmp_home / ".claude.json"
107108
cf.write_text("{}")

0 commit comments

Comments
 (0)