@@ -443,64 +443,18 @@ def test_b32encode_warns(self):
443443 expected = "base64.b32encode returns str in Python 2 (bytes in 3.x)"
444444 base64 .b32encode (b'test' )
445445 check_py3k_warnings (expected , UserWarning )
446-
446+
447447 def test_b16encode_warns (self ):
448448 expected = "base64.b16encode returns str in Python 2 (bytes in 3.x)"
449449 base64 .b16encode (b'test' )
450450 check_py3k_warnings (expected , UserWarning )
451451
452- def assertExecLocalWritebackWarning (self , recorder , local_name ):
453- self .assertEqual (len (recorder .warnings ), 1 )
454- msg = str (recorder .warnings [0 ].message )
455- self .assertTrue (msg .startswith (
456- "exec() modified local '%s'" % local_name ))
457- recorder .reset ()
458-
459452 def assertMROWarning (self , recorder , expected_message ):
460453 self .assertEqual (len (recorder .warnings ), 1 )
461454 msg = str (recorder .warnings [0 ].message )
462455 self .assertEqual (msg , expected_message )
463456 recorder .reset ()
464-
465- def test_exec_local_writeback_warning (self ):
466- def f_exec (code ):
467- b = 42
468- exec code
469- return b
470-
471- with self .check_py3k_warnings_with_fix () as w :
472- f_exec ("b = 99" )
473- self .assertExecLocalWritebackWarning (w , "b" )
474-
475- def f_exec_no_write (code ):
476- b = 42
477- exec code
478- return b
479-
480- with self .check_py3k_warnings_with_fix () as w :
481- f_exec_no_write ("print b" )
482- self .assertEqual (len (w .warnings ), 0 )
483-
484- def f_exec_overwrite (code ):
485- b = 42
486- exec code
487- b = 7
488- return b
489-
490- with self .check_py3k_warnings_with_fix () as w :
491- f_exec_overwrite ("b = 99" )
492- self .assertEqual (len (w .warnings ), 0 )
493-
494- def f_exec_explicit (code ):
495- b = 42
496- ns = {'b' : b }
497- exec code in globals (), ns
498- return b
499-
500- with self .check_py3k_warnings_with_fix () as w :
501- f_exec_explicit ("b = 99" )
502- self .assertEqual (len (w .warnings ), 0 )
503-
457+
504458 def test_classic_mro_resolution_change_warning (self ):
505459 with self .check_py3k_warnings_with_fix () as w :
506460 class A :
0 commit comments