Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/code_utils/test_config_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from __future__ import annotations

import json
import os
import sys
from pathlib import Path

Expand Down Expand Up @@ -73,7 +74,10 @@ def test_returns_none_for_nonexistent_file(self, tmp_path: Path) -> None:

assert result is None

@pytest.mark.skipif(sys.platform == "win32", reason="chmod doesn't restrict read access on Windows")
@pytest.mark.skipif(
sys.platform == "win32" or os.getuid() == 0,
reason="chmod doesn't restrict read access on Windows or when running as root"
)
def test_returns_none_for_unreadable_file(self, tmp_path: Path) -> None:
"""Should return None if file cannot be read."""
package_json = tmp_path / "package.json"
Expand Down
Loading