summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMohamed Hegazy <mhegazy@anthropic.com>2026-11-09 19:39:40 +0000
committerClaude <noreply@anthropic.com>2026-11-09 19:39:40 +0000
commit8b45f783efb8cc363cc4c7d90616c3608b531d91 (patch)
tree4a927b55c3ebf043c68f8b9152d26c74639fa52f /plugins
parentd71ce397a645800a91bb5ec525ddf3d4ab320525 (diff)
security-guidance: keep the user's own rules out of the custom rule tests
Co-authored-by: mhegazy <mhegazy@anthropic.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/security-guidance/tests/test_custom_rule_stats.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/plugins/security-guidance/tests/test_custom_rule_stats.py b/plugins/security-guidance/tests/test_custom_rule_stats.py
index 9bbc87ce..fcad3130 100644
--- a/plugins/security-guidance/tests/test_custom_rule_stats.py
+++ b/plugins/security-guidance/tests/test_custom_rule_stats.py
@@ -13,6 +13,18 @@ GLOBS = ["*.ts", "**/*.ts", "**/src/**", "**/src/**/*.ts", "src/**", "src/*.ts",
FILES = ["config.ts", "t.ts", "src/a.ts", "src/t.ts", "src/lib/a.ts", "src/lib/deep/t.ts", "other/a.ts"]
+@pytest.fixture(autouse=True)
+def _home_without_user_rules(tmp_path, monkeypatch):
+ """A home directory without the user's own rules and guidance."""
+ home = tmp_path / "home"
+ home.mkdir()
+ monkeypatch.setenv("HOME", str(home))
+ monkeypatch.setenv("USERPROFILE", str(home))
+ monkeypatch.delenv("CLAUDE_CONFIG_DIR", raising=False)
+ monkeypatch.setattr(extensibility, "_guidance_block", "")
+ monkeypatch.setattr(extensibility, "_user_patterns", [])
+
+
@pytest.mark.parametrize("glob", GLOBS)
def test_the_wider_reading_never_loses_an_include(glob, tmp_path):
for f in FILES: