code-to10 v6 A14 batch1: workers F601 duplicates and check_transplant E741 renames

(cherry picked from commit 4411186681584bf55e065c654fe909a3320d4a22)

Reconcile-conflict: test_skill_transplant_prep artifact count — kept HEAD's finalized 0 refs (2026-11-02 user sign-off deleting §4's 6 references, already in target) with incoming's l→line rename; incoming's 6-ref assertion is pre-finalization and must not overwrite.
This commit is contained in:
host committed 2026-11-03 02:49:26 +00:00
1 parent e00c255011
commit bd55599859
4 files changed
+26 -29

No files matched your search

+4 -4
View File
@@ -224,9 +224,9 @@ class ExtractTestCase(unittest.TestCase):
self.assertEqual(CT._lines("a\nb"), ["a", "b"])
lines = ["x", "y", "x"]
with self.assertRaises(ValueError):
CT._find_exact(lines, lambda l: l == "z", "missing")
CT._find_exact(lines, lambda line: line == "z", "missing")
with self.assertRaises(ValueError):
CT._find_exact(lines, lambda l: l == "x", "duplicated")
CT._find_exact(lines, lambda line: line == "x", "duplicated")
err = io.StringIO()
with contextlib.redirect_stderr(err):
self.assertEqual(CT.fail("boom"), 1)
@@ -431,8 +431,8 @@ class CheckTransplantedTestCase(unittest.TestCase):
def test_check_marker_and_matrix_errors(self):
draft = self._draft("v03")
target = _target_fixture("v03")
dropped = "\n".join(l for l in draft.split("\n")
if not l.startswith("- 标记行:"))
dropped = "\n".join(line for line in draft.split("\n")
if not line.startswith("- 标记行:"))
errors = CT.check_transplanted(target, dropped, "v03")
self.assertTrue(any("preserved marker lost" in e for e in errors))
no_row = draft.replace("| 独立审计 | 1 | 只写审计记录 | 审计结论 |\n", "")