File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 (r'[\%]{2}' , '%' ),
4040 (r'\%([.\d]+)?[bcdeEfFgGnosxX]' , r'' ),
4141 (r'\%(\([^)]*\))([.\d]+)?[bcdeEfFgGnosxX]' , r'' ),
42+ ),
43+ 'python-brace' :(
4244 (r'\{([^\:\}]*)?(:[^\}]*)?\}' , r'' ),
4345 ),
4446})
Original file line number Diff line number Diff line change @@ -129,6 +129,9 @@ def test_replace_formatters_python(self):
129129 self .assertEqual (replace_formatters ('%.02f' , 'python' ), '' )
130130 self .assertEqual (replace_formatters ('%(sth)s' , 'python' ), '' )
131131 self .assertEqual (replace_formatters ('%(sth)02f' , 'python' ), '' )
132+
133+ def test_replace_formatters_python_brace (self ):
134+ """Test removal of formatters in a python brace string."""
132135 # str.format()
133136 conditions = (
134137 ('First, thou shalt count to {0}' ,
@@ -152,7 +155,7 @@ def test_replace_formatters_python(self):
152155 )
153156 for condition in conditions :
154157 self .assertEqual (
155- replace_formatters (condition [0 ], 'python' ),
158+ replace_formatters (condition [0 ], 'python-brace ' ),
156159 condition [1 ],
157160 condition [2 ],
158161 )
You can’t perform that action at this time.
0 commit comments