@@ -188,38 +188,6 @@ def test_string_in_loop_on_same_line(self):
188
188
self .assertIn ("Missing parentheses in call to 'print'. Did you mean print(...)" ,
189
189
str (context .exception ))
190
190
191
- def test_stream_redirection_hint_for_py2_migration (self ):
192
- # Test correct hint produced for Py2 redirection syntax
193
- with self .assertRaises (TypeError ) as context :
194
- print >> sys .stderr , "message"
195
- self .assertIn ('Did you mean "print(<message>, '
196
- 'file=<output_stream>)"?' , str (context .exception ))
197
-
198
- # Test correct hint is produced in the case where RHS implements
199
- # __rrshift__ but returns NotImplemented
200
- with self .assertRaises (TypeError ) as context :
201
- print >> 42
202
- self .assertIn ('Did you mean "print(<message>, '
203
- 'file=<output_stream>)"?' , str (context .exception ))
204
-
205
- # Test stream redirection hint is specific to print
206
- with self .assertRaises (TypeError ) as context :
207
- max >> sys .stderr
208
- self .assertNotIn ('Did you mean ' , str (context .exception ))
209
-
210
- # Test stream redirection hint is specific to rshift
211
- with self .assertRaises (TypeError ) as context :
212
- print << sys .stderr
213
- self .assertNotIn ('Did you mean' , str (context .exception ))
214
-
215
- # Ensure right operand implementing rrshift still works
216
- class OverrideRRShift :
217
- def __rrshift__ (self , lhs ):
218
- return 42 # Force result independent of LHS
219
-
220
- self .assertEqual (print >> OverrideRRShift (), 42 )
221
-
222
-
223
191
224
192
if __name__ == "__main__" :
225
193
unittest .main ()
0 commit comments