From 6d009af48feb7ab4b37dfd2f13db324a1363256f Mon Sep 17 00:00:00 2001 From: host Date: Wed, 4 Nov 2026 21:38:42 +0000 Subject: [PATCH] rehearsal: ruff production 0 (drop unused agent_def os + server AuthStore imports) and quote 8 unquoted env keys in main-side test tearDowns (latent NameError) --- cloud/agent_def.py | 1 - cloud/server.py | 1 - cloud/tests/test_audit_batch2.py | 2 +- cloud/tests/test_audit_batch4.py | 8 ++++---- cloud/tests/test_audit_batch6.py | 6 +++--- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/cloud/agent_def.py b/cloud/agent_def.py index 30e8a2c..894ab35 100644 --- a/cloud/agent_def.py +++ b/cloud/agent_def.py @@ -129,7 +129,6 @@ honour that today, and this track says so instead of claiming it: """ import json -import os import re from pathlib import Path diff --git a/cloud/server.py b/cloud/server.py index 3f0b8e5..bbc33c2 100644 --- a/cloud/server.py +++ b/cloud/server.py @@ -61,7 +61,6 @@ from cloud.agent_def import parse_agent_definition as _parse_agent_definition from cloud.agent_def import resolve_registry_agent as _resolve_agent from cloud.attempts import ensure_attempts_table as _ensure_attempts from cloud.audit_loop import ensure_audit_loop_table as _ensure_audit_loop -from cloud.auth import AuthStore # 演练注:删 _parse_tools_col/_parse_tool_approvals_col(随 helper # 移 handler_support)、_MEMBER_ROLES/_coord_parse_parts(用点已随 # split 移走,server.py 内无其余引用,ruff F401 计)。 diff --git a/cloud/tests/test_audit_batch2.py b/cloud/tests/test_audit_batch2.py index 2c781fc..d2a4f7c 100644 --- a/cloud/tests/test_audit_batch2.py +++ b/cloud/tests/test_audit_batch2.py @@ -288,7 +288,7 @@ class CoordGateLookupFailureTestCase(unittest.TestCase): if self._old is None: os.environ.pop("CODEX_PUSH_ALLOW_PRIVATE_TARGETS", None) else: - os.environ[CODEX_PUSH_ALLOW_PRIVATE_TARGETS] = self._old + os.environ["CODEX_PUSH_ALLOW_PRIVATE_TARGETS"] = self._old self.tmp.cleanup() def test_direct_lookup_raises_instead_of_empty_set(self): diff --git a/cloud/tests/test_audit_batch4.py b/cloud/tests/test_audit_batch4.py index 99deaaf..5e425b5 100644 --- a/cloud/tests/test_audit_batch4.py +++ b/cloud/tests/test_audit_batch4.py @@ -245,7 +245,7 @@ class PersistedWhitespaceModelTestCase(unittest.TestCase): if self._old is None: os.environ.pop("CODEX_PUSH_ALLOW_PRIVATE_TARGETS", None) else: - os.environ[CODEX_PUSH_ALLOW_PRIVATE_TARGETS] = self._old + os.environ["CODEX_PUSH_ALLOW_PRIVATE_TARGETS"] = self._old self.tmp.cleanup() def _policy(self): @@ -308,7 +308,7 @@ class ExplicitNonSub2apiGateTestCase(unittest.TestCase): if self._old is None: os.environ.pop("CODEX_PUSH_ALLOW_PRIVATE_TARGETS", None) else: - os.environ[CODEX_PUSH_ALLOW_PRIVATE_TARGETS] = self._old + os.environ["CODEX_PUSH_ALLOW_PRIVATE_TARGETS"] = self._old self.tmp.cleanup() def _policy(self, mode, capabilities): @@ -446,7 +446,7 @@ class CoordGateAttributionTestCase(unittest.TestCase): if self._old is None: os.environ.pop("CODEX_PUSH_ALLOW_PRIVATE_TARGETS", None) else: - os.environ[CODEX_PUSH_ALLOW_PRIVATE_TARGETS] = self._old + os.environ["CODEX_PUSH_ALLOW_PRIVATE_TARGETS"] = self._old self.tmp.cleanup() def _merge(self, child_error, audit_rows=()): @@ -555,7 +555,7 @@ class GateResultsCheckedTestCase(unittest.TestCase): if self._old is None: os.environ.pop("CODEX_PUSH_ALLOW_PRIVATE_TARGETS", None) else: - os.environ[CODEX_PUSH_ALLOW_PRIVATE_TARGETS] = self._old + os.environ["CODEX_PUSH_ALLOW_PRIVATE_TARGETS"] = self._old self.tmp.cleanup() def test_direct_call_checked_subset_and_legacy(self): diff --git a/cloud/tests/test_audit_batch6.py b/cloud/tests/test_audit_batch6.py index 95a81e5..a5bc361 100644 --- a/cloud/tests/test_audit_batch6.py +++ b/cloud/tests/test_audit_batch6.py @@ -197,7 +197,7 @@ class _RunOneCase(unittest.TestCase): if self._old is None: os.environ.pop("CODEX_PUSH_ALLOW_PRIVATE_TARGETS", None) else: - os.environ[CODEX_PUSH_ALLOW_PRIVATE_TARGETS] = self._old + os.environ["CODEX_PUSH_ALLOW_PRIVATE_TARGETS"] = self._old self.tmp.cleanup() @@ -272,7 +272,7 @@ class I1MarkerTestCase(unittest.TestCase): if self._old is None: os.environ.pop("CODEX_PUSH_ALLOW_PRIVATE_TARGETS", None) else: - os.environ[CODEX_PUSH_ALLOW_PRIVATE_TARGETS] = self._old + os.environ["CODEX_PUSH_ALLOW_PRIVATE_TARGETS"] = self._old self.tmp.cleanup() def _merge(self, child_error, audit_rows=()): @@ -343,7 +343,7 @@ class _WireCase(unittest.TestCase): if self._old is None: os.environ.pop("CODEX_PUSH_ALLOW_PRIVATE_TARGETS", None) else: - os.environ[CODEX_PUSH_ALLOW_PRIVATE_TARGETS] = self._old + os.environ["CODEX_PUSH_ALLOW_PRIVATE_TARGETS"] = self._old self.tmp.cleanup() def _worker(self, **kwargs):