@@ -67,13 +67,13 @@ def __init__(self):
67
67
front_sep = r'\s|[*+-,<=(\[]'
68
68
back_sep = front_sep + r'|[>j)\]}]'
69
69
70
- fbeg = r '^{}(?={}|$)'. format ( got_floats , back_sep )
71
- fmidend = r '(?<={}){}(?={}|$)'. format ( front_sep , got_floats , back_sep )
72
- self .num_got_rgx = re .compile (r '({}|{})'. format ( fbeg , fmidend ) )
70
+ fbeg = fr '^{ got_floats } (?={ back_sep } |$)'
71
+ fmidend = fr '(?<={ front_sep } ){ got_floats } (?={ back_sep } |$)'
72
+ self .num_got_rgx = re .compile (fr '({ fbeg } |{ fmidend } )' )
73
73
74
- fbeg = r '^{}(?={}|$)'. format ( want_floats , back_sep )
75
- fmidend = r '(?<={}){}(?={}|$)'. format ( front_sep , want_floats , back_sep )
76
- self .num_want_rgx = re .compile (r '({}|{})'. format ( fbeg , fmidend ) )
74
+ fbeg = fr '^{ want_floats } (?={ back_sep } |$)'
75
+ fmidend = fr '(?<={ front_sep } ){ want_floats } (?={ back_sep } |$)'
76
+ self .num_want_rgx = re .compile (fr '({ fbeg } |{ fmidend } )' )
77
77
78
78
# As of 2023-09-26, Python base class has no init, but just in case
79
79
# it acquires one.
@@ -220,7 +220,7 @@ def normalize_floats(self, want, got, flags):
220
220
# blank line, unless the DONT_ACCEPT_BLANKLINE flag is used.
221
221
if not (flags & doctest .DONT_ACCEPT_BLANKLINE ):
222
222
# Replace <BLANKLINE> in want with a blank line.
223
- want = re .sub (r '(?m)^{}\s*?$' . format ( re .escape (doctest .BLANKLINE_MARKER )) ,
223
+ want = re .sub (fr '(?m)^{ re .escape (doctest .BLANKLINE_MARKER )} \s*?$' ,
224
224
'' , want )
225
225
# If a line in got contains only spaces, then remove the
226
226
# spaces.
0 commit comments