@@ -376,24 +376,6 @@ def test_comment_block(self):
376
376
## text.delete('1.0', 'end')
377
377
378
378
379
- code_sample = """\
380
-
381
- class C1():
382
- # Class comment.
383
- def __init__(self, a, b):
384
- self.a = a
385
- self.b = b
386
-
387
- def compare(self):
388
- if a > b:
389
- return a
390
- elif a < b:
391
- return b
392
- else:
393
- return None
394
- """
395
-
396
-
397
379
class DummyEditwin :
398
380
def __init__ (self , root , text ):
399
381
self .root = root
@@ -428,11 +410,30 @@ def tearDownClass(cls):
428
410
del cls .root
429
411
430
412
def setUp (self ):
431
- self .text .insert ('1.0' , code_sample )
413
+ self .text .insert ('1.0' , self . code_sample )
432
414
433
415
def tearDown (self ):
434
416
self .text .delete ('1.0' , 'end' )
435
417
418
+ code_sample = """\
419
+
420
+ class C1():
421
+ # Class comment.
422
+ def __init__(self, a, b):
423
+ self.a = a
424
+ self.b = b
425
+
426
+ def compare(self):
427
+ if a > b:
428
+ return a
429
+ elif a < b:
430
+ return b
431
+ else:
432
+ return None
433
+ """
434
+
435
+
436
+
436
437
def test_get_region (self ):
437
438
get = self .formatter .get_region
438
439
text = self .text
@@ -455,8 +456,8 @@ def test_set_region(self):
455
456
456
457
save_bell = text .bell
457
458
text .bell = mock .Mock ()
458
- line6 = code_sample .splitlines ()[5 ]
459
- line10 = code_sample .splitlines ()[9 ]
459
+ line6 = self . code_sample .splitlines ()[5 ]
460
+ line10 = self . code_sample .splitlines ()[9 ]
460
461
461
462
text .tag_add ('sel' , '6.0' , '11.0' )
462
463
head , tail , chars , lines = self .formatter .get_region ()
0 commit comments