mirror of
https://github.com/arsenetar/send2trash.git
synced 2025-05-08 09:49:52 +00:00
Fix test folders not getting removed
This commit is contained in:
parent
959f9044ae
commit
7c4ab4ff7e
@ -1,5 +1,6 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import unittest
|
import unittest
|
||||||
from os import path as op
|
from os import path as op
|
||||||
@ -16,10 +17,7 @@ class TestNormal(unittest.TestCase):
|
|||||||
self._create_tree(self.file)
|
self._create_tree(self.file)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
shutil.rmtree(self.dirname, ignore_errors=True)
|
||||||
os.remove(self.dirname)
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def _create_tree(self, path):
|
def _create_tree(self, path):
|
||||||
dirname = op.dirname(path)
|
dirname = op.dirname(path)
|
||||||
@ -50,10 +48,7 @@ class TestLongPath(unittest.TestCase):
|
|||||||
self._create_tree(self.file)
|
self._create_tree(self.file)
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
try:
|
shutil.rmtree(self.dirname, ignore_errors=True)
|
||||||
os.remove(self.dirname)
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def _create_tree(self, path):
|
def _create_tree(self, path):
|
||||||
dirname = op.dirname(path)
|
dirname = op.dirname(path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user