[Python-checkins] CVS: python/dist/src/Lib/test test_mailbox.py,1.1,1.1.2.1
Barry Warsaw
bwarsaw@users.sourceforge.net
Mon, 04 Jun 2001 12:35:06 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv10256
Modified Files:
Tag: release20-maint
test_mailbox.py
Log Message:
Backported two fixes from the Py2.1 tree (pre-unittest rewrite):
----------------------------
revision 1.3
date: 2001/04/10 15:01:20; author: gvanrossum; state: Exp; lines: +6 -0
Some other tests, when failing, don't always remove their TESTFN file.
Try to do it for them, so our mkdir() operation doesn't fail.
----------------------------
revision 1.2
date: 2001/03/02 05:46:17; author: gvanrossum; state: Exp; lines: +3 -3
When catching errors from os.rmdir(), test for os.error, not IOError!
----------------------------
except I used OSError instead of os.error.
Index: test_mailbox.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_mailbox.py,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -C2 -r1.1 -r1.1.2.1
*** test_mailbox.py 2000/10/23 13:39:13 1.1
--- test_mailbox.py 2001/06/04 19:35:04 1.1.2.1
***************
*** 3,6 ****
--- 3,12 ----
import test_support
+ # cleanup the turds of some of the other tests. :(
+ try:
+ os.unlink(test_support.TESTFN)
+ except OSError:
+ pass
+
# create a new maildir mailbox to work with:
curdir = os.path.join(test_support.TESTFN, "cur")
***************
*** 22,28 ****
finally:
try: os.rmdir(newdir)
! except IOError: pass
try: os.rmdir(curdir)
! except IOError: pass
try: os.rmdir(test_support.TESTFN)
! except IOError: pass
--- 28,34 ----
finally:
try: os.rmdir(newdir)
! except OSError: pass
try: os.rmdir(curdir)
! except OSError: pass
try: os.rmdir(test_support.TESTFN)
! except OSError: pass