[Python-checkins] CVS: python/dist/src/Lib/test test_support.py,1.25,1.26

Barry Warsaw bwarsaw@users.sourceforge.net
2001年8月20日 15:29:25 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv9150
Modified Files:
	test_support.py 
Log Message:
use_large_resources => use_resources
requires(): New function which can be used to `assert' that a specific
 -u/--use resource flag is present. Raises a TestSkipped if not.
 This is used in test_largefile and test_socket_ssl to enable
 external or resource consumptive tests that are normally
 disabled.
Index: test_support.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** test_support.py	2001年08月17日 18:39:24	1.25
--- test_support.py	2001年08月20日 22:29:23	1.26
***************
*** 20,25 ****
 """
 
! verbose = 1 # Flag set to 0 by regrtest.py
! use_large_resources = 1 # Flag set to 0 by regrtest.py
 
 def unload(name):
--- 20,25 ----
 """
 
! verbose = 1 # Flag set to 0 by regrtest.py
! use_resources = [] # Flag set to [] by regrtest.py
 
 def unload(name):
***************
*** 37,40 ****
--- 37,46 ----
 except os.error:
 pass
+ 
+ def requires(resource, msg=None):
+ if resource not in use_resources:
+ if msg is None:
+ msg = "Use of the `%s' resource not enabled" % resource
+ raise TestSkipped(msg)
 
 FUZZ = 1e-6

AltStyle によって変換されたページ (->オリジナル) /