[Zope3-checkins] CVS: Zope3/src/zope/fssync/tests - test_merger.py:1.2 test_metadata.py:1.2
Guido van Rossum
guido@python.org
Mon, 12 May 2003 16:41:23 -0400
Update of /cvs-repository/Zope3/src/zope/fssync/tests
In directory cvs.zope.org:/tmp/cvs-serv3992
Modified Files:
test_merger.py test_metadata.py
Log Message:
At Tim's recommendation, don't catch os.error when unlinking files.
Use 'if isfile(fn): os.remove(fn)' instead.
=== Zope3/src/zope/fssync/tests/test_merger.py 1.1 => 1.2 ===
--- Zope3/src/zope/fssync/tests/test_merger.py:1.1 Mon May 12 16:19:39 2003
+++ Zope3/src/zope/fssync/tests/test_merger.py Mon May 12 16:41:23 2003
@@ -65,13 +65,10 @@
def tearDown(self):
# Clean up temporary files (or directories)
for fn in self.tempfiles:
- try:
- if isdir(fn):
- shutil.rmtree(fn)
- else:
- os.unlink(fn)
- except os.error:
- pass
+ if isdir(fn):
+ shutil.rmtree(fn)
+ elif isfile(fn):
+ os.remove(fn)
unittest.TestCase.tearDown(self)
def addfile(self, data, suffix="", mode="w"):
=== Zope3/src/zope/fssync/tests/test_metadata.py 1.1 => 1.2 ===
--- Zope3/src/zope/fssync/tests/test_metadata.py:1.1 Mon May 12 16:19:39 2003
+++ Zope3/src/zope/fssync/tests/test_metadata.py Mon May 12 16:41:23 2003
@@ -37,13 +37,10 @@
def tearDown(self):
# Clean up temporary files (or directories)
for fn in self.tempfiles:
- try:
- if isdir(fn):
- shutil.rmtree(fn)
- else:
- os.unlink(fn)
- except os.error:
- pass
+ if isdir(fn):
+ shutil.rmtree(fn)
+ elif isfile(fn):
+ os.remove(fn)
unittest.TestCase.tearDown(self)
def adddir(self):