Fail the tests that skipped at run time, naming what they miss, and give CI's tests docker

This commit is contained in:
2026-11-18 17:33:04 +01:00
parent fa34d832aa
commit 9cc505b764
11 changed files with 37 additions and 39 deletions
+6
View File
@@ -1,7 +1,13 @@
import os
import unittest
# A git hook's GIT_DIR, the host's LOOP_CLAUDE_* or PYTHONPATH would point the program under test at the host's own state,
# and the host's CLAUDE_CODE_SANDBOXED would hide whether loop-claude sets it.
def isolated_env() -> dict[str, str]:
return {name: value for name, value in os.environ.items() if not name.startswith(("GIT_", "LOOP_CLAUDE_", "PYTHON")) and name != "CLAUDE_CODE_SANDBOXED"}
# Root ignores file permissions, so a test that makes a file unreadable or a folder read-only needs another user.
def assert_not_root(test: unittest.TestCase) -> None:
test.assertNotEqual(os.geteuid(), 0, "this test needs file permissions to bind it, which they don't for root: run the tests as another user")