Fix test folders not getting removed

This commit is contained in:
sharkykh 2019-04-30 19:23:48 +03:00 committed by GitHub
parent 959f9044ae
commit 7c4ab4ff7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 8 deletions

View File

@ -1,5 +1,6 @@
# coding: utf-8
import os
import shutil
import sys
import unittest
from os import path as op
@ -16,10 +17,7 @@ class TestNormal(unittest.TestCase):
self._create_tree(self.file)
def tearDown(self):
try:
os.remove(self.dirname)
except OSError:
pass
shutil.rmtree(self.dirname, ignore_errors=True)
def _create_tree(self, path):
dirname = op.dirname(path)
@ -50,10 +48,7 @@ class TestLongPath(unittest.TestCase):
self._create_tree(self.file)
def tearDown(self):
try:
os.remove(self.dirname)
except OSError:
pass
shutil.rmtree(self.dirname, ignore_errors=True)
def _create_tree(self, path):
dirname = op.dirname(path)