[Python-checkins] CVS: python/dist/src/Lib/test README,1.2,1.3 test_binhex.py,1.4,1.5 test_dl.py,1.7,1.8 test_fork1.py,1.4,1.5 test_gl.py,1.3,1.4 test_nis.py,1.7,1.8 test_openpty.py,1.2,1.3 test_pty.py,1.3,1.4 test_signal.py,1.4,1.5 test_string.py,1.10,1.11
Thomas Wouters
python-dev@python.org
Fri, 4 Aug 2000 06:34:46 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv3456
Modified Files:
README test_binhex.py test_dl.py test_fork1.py test_gl.py
test_nis.py test_openpty.py test_pty.py test_signal.py
test_string.py
Log Message:
Raise 'TestSkipped' (from the test_support) module rather than 'ImportError'
to signify a test that should be marked as 'skipped' rather than 'failed'.
Also 'document' it, in README.
Index: README
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/README,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** README 2000/07/19 17:19:49 1.2
--- README 2000/08/04 13:34:43 1.3
***************
*** 13,17 ****
expected output that is stored in .../Lib/test/output. If the test runs to
completion and the actual and expected outputs match, the test succeeds, if
! not, it fails. If an ImportError is raised, the test is not run.
You will be writing unit tests (isolated tests of functions and objects
--- 13,18 ----
expected output that is stored in .../Lib/test/output. If the test runs to
completion and the actual and expected outputs match, the test succeeds, if
! not, it fails. If an ImportError or test_support.TestSkipped error is
! raised, the test is not run.
You will be writing unit tests (isolated tests of functions and objects
Index: test_binhex.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_binhex.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** test_binhex.py 1999/10/19 17:48:54 1.4
--- test_binhex.py 2000/08/04 13:34:43 1.5
***************
*** 7,11 ****
import binhex
import tempfile
! from test_support import verbose
def test():
--- 7,11 ----
import binhex
import tempfile
! from test_support import verbose, TestSkipped
def test():
***************
*** 16,20 ****
f = open(fname1, 'w')
except:
! raise ImportError, "Cannot test binhex without a temp file"
start = 'Jack is my hero'
--- 16,20 ----
f = open(fname1, 'w')
except:
! raise TestSkipped, "Cannot test binhex without a temp file"
start = 'Jack is my hero'
Index: test_dl.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_dl.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** test_dl.py 1999/02/23 17:58:48 1.7
--- test_dl.py 2000/08/04 13:34:43 1.8
***************
*** 5,9 ****
import dl
! from test_support import verbose
sharedlibs = [
--- 5,9 ----
import dl
! from test_support import verbose,TestSkipped
sharedlibs = [
***************
*** 30,32 ****
break
else:
! raise ImportError, 'Could not open any shared libraries'
--- 30,32 ----
break
else:
! raise TestSkipped, 'Could not open any shared libraries'
Index: test_fork1.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_fork1.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** test_fork1.py 2000/05/04 00:36:42 1.4
--- test_fork1.py 2000/08/04 13:34:43 1.5
***************
*** 10,18 ****
import os, sys, time, thread
try:
os.fork
except AttributeError:
! raise ImportError, "os.fork not defined -- skipping test_fork1"
LONGSLEEP = 2
--- 10,19 ----
import os, sys, time, thread
+ from test_support import TestSkipped
try:
os.fork
except AttributeError:
! raise TestSkipped, "os.fork not defined -- skipping test_fork1"
LONGSLEEP = 2
Index: test_gl.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_gl.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** test_gl.py 1998/03/26 19:42:09 1.3
--- test_gl.py 2000/08/04 13:34:43 1.4
***************
*** 4,8 ****
Roger E. Masse
"""
! from test_support import verbose
import gl, GL, time
--- 4,8 ----
Roger E. Masse
"""
! from test_support import verbose, TestSkipped
import gl, GL, time
***************
*** 88,93 ****
display = os.environ['DISPLAY']
except:
! # Raise ImportError because regrtest.py handles it specially.
! raise ImportError, "No $DISPLAY -- skipping gl test"
# touch all the attributes of gl without doing anything
--- 88,92 ----
display = os.environ['DISPLAY']
except:
! raise TestSkipped, "No $DISPLAY -- skipping gl test"
# touch all the attributes of gl without doing anything
Index: test_nis.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_nis.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** test_nis.py 1999/01/28 04:54:33 1.7
--- test_nis.py 2000/08/04 13:34:43 1.8
***************
*** 1,3 ****
! from test_support import verbose, TestFailed
import nis
--- 1,3 ----
! from test_support import verbose, TestFailed, TestSkipped
import nis
***************
*** 10,14 ****
raise TestFailed, msg
# only do this if running under the regression suite
! raise ImportError, msg
done = 0
--- 10,14 ----
raise TestFailed, msg
# only do this if running under the regression suite
! raise TestSkipped, msg
done = 0
Index: test_openpty.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_openpty.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** test_openpty.py 2000/07/19 14:51:54 1.2
--- test_openpty.py 2000/08/04 13:34:43 1.3
***************
*** 2,6 ****
import os
! from test_support import verbose, TestFailed
try:
--- 2,6 ----
import os
! from test_support import verbose, TestFailed, TestSkipped
try:
***************
*** 11,15 ****
print "(master, slave) = (%d, %d)"%(master, slave)
except AttributeError:
! raise ImportError, "No openpty() available."
if not os.isatty(master):
--- 11,15 ----
print "(master, slave) = (%d, %d)"%(master, slave)
except AttributeError:
! raise TestSkipped, "No openpty() available."
if not os.isatty(master):
Index: test_pty.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pty.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** test_pty.py 2000/07/19 14:51:54 1.3
--- test_pty.py 2000/08/04 13:34:43 1.4
***************
*** 1,4 ****
import pty, os, sys, string
! from test_support import verbose, TestFailed
TEST_STRING_1 = "I wish to buy a fish license."
--- 1,4 ----
import pty, os, sys, string
! from test_support import verbose, TestFailed, TestSkipped
TEST_STRING_1 = "I wish to buy a fish license."
***************
*** 26,30 ****
except OSError:
# " An optional feature could not be imported " ... ?
! raise ImportError, "Pseudo-terminals (seemingly) not functional."
if not os.isatty(master_fd):
--- 26,30 ----
except OSError:
# " An optional feature could not be imported " ... ?
! raise TestSkipped, "Pseudo-terminals (seemingly) not functional."
if not os.isatty(master_fd):
Index: test_signal.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_signal.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** test_signal.py 1997/11/22 21:50:25 1.4
--- test_signal.py 2000/08/04 13:34:43 1.5
***************
*** 1,4 ****
# Test the signal module
! from test_support import verbose
import signal
import os
--- 1,4 ----
# Test the signal module
! from test_support import verbose, TestSkipped
import signal
import os
***************
*** 6,10 ****
if sys.platform[:3] in ('win', 'os2'):
! raise ImportError, "Can't test signal on %s" % sys.platform[:3]
if verbose:
--- 6,10 ----
if sys.platform[:3] in ('win', 'os2'):
! raise TestSkipped, "Can't test signal on %s" % sys.platform[:3]
if verbose:
Index: test_string.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_string.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** test_string.py 2000/07/10 17:08:42 1.10
--- test_string.py 2000/08/04 13:34:43 1.11
***************
*** 1,3 ****
! from test_support import verbose
import string_tests
import string, sys
--- 1,3 ----
! from test_support import verbose, TestSkipped
import string_tests
import string, sys
***************
*** 7,11 ****
''.join
except AttributeError:
! raise ImportError
def test(name, input, output, *args):
--- 7,11 ----
''.join
except AttributeError:
! raise TestSkipped
def test(name, input, output, *args):