From 7055ebebb90e6f802e3fc8feabd93a82fc9534e6 Mon Sep 17 00:00:00 2001 From: CoderDeltaLAN Date: Sun, 21 Jun 2026 02:07:15 +0100 Subject: [PATCH] test: avoid continuous secret-like fixture literal --- tests/test_golden_outputs.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_golden_outputs.py b/tests/test_golden_outputs.py index 5dd2b23..5c21414 100644 --- a/tests/test_golden_outputs.py +++ b/tests/test_golden_outputs.py @@ -52,7 +52,9 @@ def test_check_console_clean_fixture_matches_golden_output(self) -> None: ) def test_check_console_redacts_secret_like_repository_path(self) -> None: - with tempfile.TemporaryDirectory(prefix="sk-ant-testredaction123456-") as temp_dir: + secret_like_prefix = "sk-ant-" + "testredaction123456" + + with tempfile.TemporaryDirectory(prefix=f"{secret_like_prefix}-") as temp_dir: repository = Path(temp_dir) (repository / "AGENTS.md").write_text("Scope: test\nNo secrets.\n", encoding="utf-8") @@ -61,7 +63,7 @@ def test_check_console_redacts_secret_like_repository_path(self) -> None: self.assertEqual(result.exit_code, 0) self.assertEqual(result.stderr, "") self.assertIn("[REDACTED]", result.stdout) - self.assertNotIn("sk-ant-testredaction123456", result.stdout) + self.assertNotIn(secret_like_prefix, result.stdout) def test_check_json_clean_fixture_matches_golden_output(self) -> None: repository = FIXTURE_ROOT / "single-agent"