55
66
77def  set_command_line_args (args ):
8-     """  Set (what would otherwise be) command-line arguments  """ 
8+     """Set (what would otherwise be) command-line arguments""" 
99    return  argparse .Namespace (** args )
1010
1111
@@ -32,25 +32,22 @@ def setUpClass(self):
3232        # allow for full diff output 
3333        # self.maxDiff = None 
3434
35- 
3635    def  test_replace_reference (self ):
37-         """  Inline reference replacement  """ 
36+         """Inline reference replacement""" 
3837        # use the link regex from the fnsort import 
39-             
38+ 
4039        # "search" function only returns the first match 
4140        match  =  fnsort .link .search (self .text )
4241        order  =  ["1" , "3" , "4" , "2" ]
4342
4443        # hedgehogs[^1] 
45-         self .assertEqual (
46-             fnsort .replace_reference (match , order ),
47-             "s[^1]" 
48-         )
49- 
44+         self .assertEqual (fnsort .replace_reference (match , order ), "s[^1]" )
5045
5146    def  test_footnote_sort (self ):
52-         """ Entire footnote sort process """ 
53-         self .assertEqual (fnsort .sort_footnotes (self .text , self .args ), self .expected_text )
47+         """Entire footnote sort process""" 
48+         self .assertEqual (
49+             fnsort .sort_footnotes (self .text , self .args ), self .expected_text 
50+         )
5451
5552
5653class  TestDuplicates (unittest .TestCase ):
@@ -73,29 +70,34 @@ def setUpClass(self):
7370        # allow for full diff output 
7471        # self.maxDiff = None 
7572
76- 
7773    def  test_replace_references_with_dups (self ):
78-         """  Multiple reference replacements with duplicate tags  """ 
74+         """Multiple reference replacements with duplicate tags""" 
7975        # find all matches 
8076        matches  =  fnsort .link .finditer (self .text )
8177        order  =  ["1" , "3" , "2" , "5" , "4" ]
8278
8379        # should be seven regex matches in duplicates.md 
8480        expected  =  [
85-             "s[^1]" , "s[^2]" , " [^1]" , "s[^3]" , "s[^4]" , "s[^5]" , " [^2]" 
81+             "s[^1]" ,
82+             "s[^2]" ,
83+             " [^1]" ,
84+             "s[^3]" ,
85+             "s[^4]" ,
86+             "s[^5]" ,
87+             " [^2]" ,
8688        ]
8789
8890        # multiple assertions 
8991        for  i , match  in  enumerate (matches ):
9092            self .assertEqual (
91-                 fnsort .replace_reference (match , order ),
92-                 expected [i ]
93+                 fnsort .replace_reference (match , order ), expected [i ]
9394            )
9495
95- 
9696    def  test_footnote_sort_with_dups (self ):
97-         """ Entire footnote sort process with duplicate tags """ 
98-         self .assertEqual (fnsort .sort_footnotes (self .text , self .args ), self .expected_text )
97+         """Entire footnote sort process with duplicate tags""" 
98+         self .assertEqual (
99+             fnsort .sort_footnotes (self .text , self .args ), self .expected_text 
100+         )
99101
100102
101103class  TestFootnotesMustBeLast (unittest .TestCase ):
@@ -118,9 +120,8 @@ def setUpClass(self):
118120        # allow for full diff output 
119121        # self.maxDiff = None 
120122
121- 
122123    def  test_footnote_sort_trailing_text (self ):
123-         """  [negative test] Entire footnote sort process with text after the footnotes  """ 
124+         """[negative test] Entire footnote sort process with text after the footnotes""" 
124125
125126        """ 
126127        negative test 
@@ -130,7 +131,9 @@ def test_footnote_sort_trailing_text(self):
130131
131132        in short this is not expected to return the desired output 
132133        """ 
133-         self .assertNotEqual (fnsort .sort_footnotes (self .text , self .args ), self .expected_text )
134+         self .assertNotEqual (
135+             fnsort .sort_footnotes (self .text , self .args ), self .expected_text 
136+         )
134137
135138
136139class  TestAdjacentFootnotes (unittest .TestCase ):
@@ -154,24 +157,23 @@ def setUpClass(self):
154157        # allow for full diff output 
155158        # self.maxDiff = None 
156159
157- 
158160    def  test_adjacent_inline_reference_spacing (self ):
159-         """  Test spacing out adjacent inline references  """ 
160-         with  open (f "tests/adjacent/adjacent_spacing.md"as  fh :
161+         """Test spacing out adjacent inline references""" 
162+         with  open ("tests/adjacent/adjacent_spacing.md" ) as  fh :
161163            spacing_text  =  fh .read ()
162164
163165        self .assertEqual (
164-             fnsort .space_adjacent_references (self .text ),
165-             spacing_text 
166+             fnsort .space_adjacent_references (self .text ), spacing_text 
166167        )
167168
168- 
169169    def  test_adjacent_footnote_sort (self ):
170-         """  Entire footnote sort process with adjacent footnote references  """ 
170+         """Entire footnote sort process with adjacent footnote references""" 
171171        if  self .args .adjacent :
172172            self .text  =  fnsort .space_adjacent_references (self .text )
173173
174-         self .assertEqual (fnsort .sort_footnotes (self .text , self .args ), self .expected_text )
174+         self .assertEqual (
175+             fnsort .sort_footnotes (self .text , self .args ), self .expected_text 
176+         )
175177
176178
177179class  TestKeepFootnoteNames (unittest .TestCase ):
@@ -192,13 +194,14 @@ def setUpClass(self):
192194        # allow for full diff output 
193195        # self.maxDiff = None 
194196
195- 
196197    def  test_keep_footnote_names (self ):
197-         """  Entire footnote sort process while retaining footnote names  """ 
198+         """Entire footnote sort process while retaining footnote names""" 
198199        if  self .args .adjacent :
199200            self .text  =  fnsort .space_adjacent_references (self .text )
200201
201-         self .assertEqual (fnsort .sort_footnotes (self .text , self .args ), self .expected_text )
202+         self .assertEqual (
203+             fnsort .sort_footnotes (self .text , self .args ), self .expected_text 
204+         )
202205
203206
204207class  TestMissingFootnotes (unittest .TestCase ):
@@ -219,7 +222,6 @@ def setUpClass(self):
219222        # allow for full diff output 
220223        # self.maxDiff = None 
221224
222- 
223225    def  test_missing_footnotes (self ):
224226        """ 
225227        [negative test] Entire footnote sort process with missing footnotes and inline references 
0 commit comments