1818from bpython import args
1919from bpython ._py3compat import py3
2020from bpython .test import (FixLanguageTestCase as TestCase , MagicIterMock , mock ,
21- builtin_target , unittest )
21+ unittest )
2222
2323from curtsies import events
2424
@@ -299,8 +299,8 @@ def setUp(self):
299299 self .open = partial (io .open , mode = 'wt' , encoding = 'utf-8' )
300300 self .dont_write_bytecode = sys .dont_write_bytecode
301301 sys .dont_write_bytecode = True
302- self .sys_path = sys .path #?
303- sys .path = self .sys_path [:] #?
302+ self .sys_path = sys .path
303+ sys .path = self .sys_path [:]
304304
305305 # Because these tests create Python source files at runtime,
306306 # it's possible in Python >=3.3 for the importlib.machinery.FileFinder
@@ -318,7 +318,7 @@ def setUp(self):
318318
319319 def tearDown (self ):
320320 sys .dont_write_bytecode = self .dont_write_bytecode
321- sys .path = self .sys_path #?
321+ sys .path = self .sys_path
322322
323323 def push (self , line ):
324324 self .repl ._current_line = line
@@ -358,21 +358,21 @@ def test_import_module_with_rewind(self):
358358 with self .open (fullpath ) as f :
359359 f .write ('a = 0\n ' )
360360 self .head (path )
361- self .push ('import %s' % (modname )) # SOMETIMES THIS MAKES THE OTHER TEST FAIL!!!
362- # self.assertIn(modname, self.repl.interp.locals)
361+ self .push ('import %s' % (modname ))
362+ self .assertIn (modname , self .repl .interp .locals )
363363 self .repl .undo ()
364- # self.assertNotIn(modname, self.repl.interp.locals)
364+ self .assertNotIn (modname , self .repl .interp .locals )
365365 self .repl .clear_modules_and_reevaluate ()
366- # self.assertNotIn(modname, self.repl.interp.locals)
367- # self.push('import %s' % (modname))
368- # self.push('a = %s.a' % (modname))
369- # self.assertIn('a', self.repl.interp.locals)
370- # self.assertEqual(self.repl.interp.locals['a'], 0)
366+ self .assertNotIn (modname , self .repl .interp .locals )
367+ self .push ('import %s' % (modname ))
368+ self .push ('a = %s.a' % (modname ))
369+ self .assertIn ('a' , self .repl .interp .locals )
370+ self .assertEqual (self .repl .interp .locals ['a' ], 0 )
371371 with self .open (fullpath ) as f :
372372 f .write ('a = 1\n ' )
373- # self.repl.clear_modules_and_reevaluate()
374- # self.assertIn('a', self.repl.interp.locals)
375- # self.assertEqual(self.repl.interp.locals['a'], 1)
373+ self .repl .clear_modules_and_reevaluate ()
374+ self .assertIn ('a' , self .repl .interp .locals )
375+ self .assertEqual (self .repl .interp .locals ['a' ], 1 )
376376
377377
378378class TestCurtsiesPagerText (TestCase ):
@@ -443,7 +443,6 @@ def test_control_events_in_small_paste(self):
443443 self .repl .process_event (p )
444444 self .assertEqual (self .repl .current_line , 'eabcd' )
445445
446-
447446 def test_control_events_in_large_paste (self ):
448447 """Large paste events should ignore control characters"""
449448 p = events .PasteEvent ()
0 commit comments