File tree Expand file tree Collapse file tree 1 file changed +29
-13
lines changed
Expand file tree Collapse file tree 1 file changed +29
-13
lines changed Original file line number Diff line number Diff line change @@ -112,19 +112,35 @@ def gfunc():
112112
113113 global_not_found = "name 'gfunc' is not defined"
114114
115- expected = (
116- "Traceback (most recent call last):\n File "
117- + green ('"<input>"' )
118- + ", line "
119- + bold (magenta ("1" ))
120- + ", in "
121- + cyan ("<module>" )
122- + "\n gfunc()\n "
123- + bold (red ("NameError" ))
124- + ": "
125- + cyan (global_not_found )
126- + "\n "
127- )
115+ if (3 , 11 ) <= sys .version_info [:2 ]:
116+ expected = (
117+ "Traceback (most recent call last):\n File "
118+ + green ('"<input>"' )
119+ + ", line "
120+ + bold (magenta ("1" ))
121+ + ", in "
122+ + cyan ("<module>" )
123+ + "\n gfunc()"
124+ + "\n ^^^^^\n "
125+ + bold (red ("NameError" ))
126+ + ": "
127+ + cyan (global_not_found )
128+ + "\n "
129+ )
130+ else :
131+ expected = (
132+ "Traceback (most recent call last):\n File "
133+ + green ('"<input>"' )
134+ + ", line "
135+ + bold (magenta ("1" ))
136+ + ", in "
137+ + cyan ("<module>" )
138+ + "\n gfunc()\n "
139+ + bold (red ("NameError" ))
140+ + ": "
141+ + cyan (global_not_found )
142+ + "\n "
143+ )
128144
129145 self .assertMultiLineEqual (str (plain ("" ).join (a )), str (expected ))
130146 self .assertEqual (plain ("" ).join (a ), expected )
You can’t perform that action at this time.
0 commit comments