File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -352,22 +352,22 @@ class EnsureSafeUserHistory(unittest.TestCase):
352
352
353
353
@classmethod
354
354
def setUpClass (cls ):
355
+ super ().setUpClass ()
355
356
cls .__history_file = cls .__history_stat = None
356
357
history_file = _site_gethistoryfile ()
357
358
if os .path .exists (history_file ):
358
359
cls .__history_file = history_file
359
360
cls .__history_stat = _file_signature (history_file )
360
361
361
362
def tearDown (self ):
363
+ if self .__history_file is not None :
364
+ self .assertTrue (
365
+ os .path .exists (self .__history_file ),
366
+ f"PYTHON_HISTORY file ({ self .__history_file !r} ) was deleted"
367
+ )
368
+ self .assertEqual (
369
+ self .__history_stat ,
370
+ _file_signature (self .__history_file ),
371
+ f"PYTHON_HISTORY file ({ self .__history_file !r} ) was altered"
372
+ )
362
373
super ().tearDown ()
363
- if self .__history_file is None :
364
- return
365
- self .assertTrue (
366
- os .path .exists (self .__history_file ),
367
- f"PYTHON_HISTORY file ({ self .__history_file !r} ) was deleted"
368
- )
369
- self .assertEqual (
370
- self .__history_stat ,
371
- _file_signature (self .__history_file ),
372
- f"PYTHON_HISTORY file ({ self .__history_file !r} ) was altered"
373
- )
You can’t perform that action at this time.
0 commit comments