55# To run these tests:
66# python3 check_alphabetical_order_test.py -v
77
8+ import check_alphabetical_order as _mod
9+ from contextlib import redirect_stderr
810import io
911import os
1012import tempfile
11- import unittest
12- from contextlib import redirect_stderr
13- from typing import cast
1413import textwrap
15-
16-
17- import check_alphabetical_order as _mod
14+ from typing import cast
15+ import unittest
1816
1917
2018class TestAlphabeticalOrderCheck (unittest .TestCase ):
21- def test_normalize_list_rst_sorts_rows (self ):
19+ def test_normalize_list_rst_sorts_rows (self ) -> None :
2220 input_text = textwrap .dedent (
2321 """\
2422 .. csv-table:: Clang-Tidy checks
@@ -46,7 +44,7 @@ def test_normalize_list_rst_sorts_rows(self):
4644 out_str = _mod .normalize_list_rst (input_text )
4745 self .assertEqual (out_str , expected_text )
4846
49- def test_find_heading (self ):
47+ def test_find_heading (self ) -> None :
5048 text = textwrap .dedent (
5149 """\
5250 - Deprecated the :program:`clang-tidy` ``zircon`` module. All checks have been
@@ -63,7 +61,7 @@ def test_find_heading(self):
6361 idx = _mod .find_heading (lines , "New checks" )
6462 self .assertEqual (idx , 4 )
6563
66- def test_duplicate_detection_and_report (self ):
64+ def test_duplicate_detection_and_report (self ) -> None :
6765 # Ensure duplicate detection works properly when sorting is incorrect.
6866 text = textwrap .dedent (
6967 """\
@@ -113,7 +111,7 @@ def test_duplicate_detection_and_report(self):
113111 )
114112 self .assertEqual (report_str , expected_report )
115113
116- def test_process_release_notes_with_unsorted_content (self ):
114+ def test_process_release_notes_with_unsorted_content (self ) -> None :
117115 # When content is not normalized, the function writes normalized text and returns 0.
118116 rn_text = textwrap .dedent (
119117 """\
@@ -168,7 +166,7 @@ def test_process_release_notes_with_unsorted_content(self):
168166 self .assertEqual (out , expected_out )
169167 self .assertIn ("not normalized" , buf .getvalue ())
170168
171- def test_process_release_notes_prioritizes_sorting_over_duplicates (self ):
169+ def test_process_release_notes_prioritizes_sorting_over_duplicates (self ) -> None :
172170 # Sorting is incorrect and duplicates exist, should report ordering issues first.
173171 rn_text = textwrap .dedent (
174172 """\
@@ -234,7 +232,7 @@ def test_process_release_notes_prioritizes_sorting_over_duplicates(self):
234232 )
235233 self .assertEqual (out , expected_out )
236234
237- def test_process_release_notes_with_duplicates_fails (self ):
235+ def test_process_release_notes_with_duplicates_fails (self ) -> None :
238236 # Sorting is already correct but duplicates exist, should return 3 and report.
239237 rn_text = textwrap .dedent (
240238 """\
@@ -295,7 +293,7 @@ def test_process_release_notes_with_duplicates_fails(self):
295293 out = f .read ()
296294 self .assertEqual (out , rn_text )
297295
298- def test_release_notes_handles_nested_sub_bullets (self ):
296+ def test_release_notes_handles_nested_sub_bullets (self ) -> None :
299297 rn_text = textwrap .dedent (
300298 """\
301299 Changes in existing checks
@@ -355,7 +353,7 @@ def test_release_notes_handles_nested_sub_bullets(self):
355353 )
356354 self .assertEqual (out , expected_out )
357355
358- def test_process_checks_list_normalizes_output (self ):
356+ def test_process_checks_list_normalizes_output (self ) -> None :
359357 list_text = textwrap .dedent (
360358 """\
361359 .. csv-table:: List
0 commit comments