Commit 9596a78a authored by Neal Norwitz's avatar Neal Norwitz

Don't fail if the directory already exists

parent 0df80697
import os, filecmp, shutil, tempfile import os, filecmp, shutil, tempfile, shutil
import unittest import unittest
from test import test_support from test import test_support
...@@ -49,6 +49,7 @@ class DirCompareTestCase(unittest.TestCase): ...@@ -49,6 +49,7 @@ class DirCompareTestCase(unittest.TestCase):
self.caseinsensitive = os.path.normcase('A') == os.path.normcase('a') self.caseinsensitive = os.path.normcase('A') == os.path.normcase('a')
data = 'Contents of file go here.\n' data = 'Contents of file go here.\n'
for dir in [self.dir, self.dir_same, self.dir_diff]: for dir in [self.dir, self.dir_same, self.dir_diff]:
shutil.rmtree(dir, True)
os.mkdir(dir) os.mkdir(dir)
if self.caseinsensitive and dir is self.dir_same: if self.caseinsensitive and dir is self.dir_same:
fn = 'FiLe' # Verify case-insensitive comparison fn = 'FiLe' # Verify case-insensitive comparison
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment