Skip to content

Commit daa658a

Browse files
gh-113317: Argument Clinic: tear out internal text accumulator APIs (#113402)
Replace the internal accumulator APIs by using lists of strings and join(). Yak-shaving for separating out formatting code into a separate file. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
1 parent a0d3d3e commit daa658a

File tree

2 files changed

+89
-188
lines changed

2 files changed

+89
-188
lines changed

Lib/test/test_clinic.py

-30
Original file line numberDiff line numberDiff line change
@@ -3761,20 +3761,6 @@ def test_normalize_snippet(self):
37613761
actual = clinic.normalize_snippet(snippet, indent=indent)
37623762
self.assertEqual(actual, expected)
37633763

3764-
def test_accumulator(self):
3765-
acc = clinic.text_accumulator()
3766-
self.assertEqual(acc.output(), "")
3767-
acc.append("a")
3768-
self.assertEqual(acc.output(), "a")
3769-
self.assertEqual(acc.output(), "")
3770-
acc.append("b")
3771-
self.assertEqual(acc.output(), "b")
3772-
self.assertEqual(acc.output(), "")
3773-
acc.append("c")
3774-
acc.append("d")
3775-
self.assertEqual(acc.output(), "cd")
3776-
self.assertEqual(acc.output(), "")
3777-
37783764
def test_quoted_for_c_string(self):
37793765
dataset = (
37803766
# input, expected
@@ -3790,22 +3776,6 @@ def test_quoted_for_c_string(self):
37903776
out = clinic.quoted_for_c_string(line)
37913777
self.assertEqual(out, expected)
37923778

3793-
def test_rstrip_lines(self):
3794-
lines = (
3795-
"a \n"
3796-
"b\n"
3797-
" c\n"
3798-
" d \n"
3799-
)
3800-
expected = (
3801-
"a\n"
3802-
"b\n"
3803-
" c\n"
3804-
" d\n"
3805-
)
3806-
out = clinic.rstrip_lines(lines)
3807-
self.assertEqual(out, expected)
3808-
38093779
def test_format_escape(self):
38103780
line = "{}, {a}"
38113781
expected = "{{}}, {{a}}"

0 commit comments

Comments
 (0)