[Python-checkins] python/dist/src/Lib unittest.py,1.27,1.28

purcell at users.sourceforge.net purcell at users.sourceforge.net
Tue Sep 23 04:41:55 EDT 2003


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv28165

Modified Files:
	unittest.py 
Log Message:
Topical change: use 'startswith()' to identify test methods with a
given prefix rather than comparing a slice.


Index: unittest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/unittest.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** unittest.py	22 Sep 2003 11:08:12 -0000	1.27
--- unittest.py	23 Sep 2003 08:41:53 -0000	1.28
***************
*** 47,51 ****
  __author__ = "Steve Purcell"
  __email__ = "stephen_purcell at yahoo dot com"
! __version__ = "#Revision: 1.56 $"[11:-2]
  
  import time
--- 47,51 ----
  __author__ = "Steve Purcell"
  __email__ = "stephen_purcell at yahoo dot com"
! __version__ = "#Revision: 1.57 $"[11:-2]
  
  import time
***************
*** 541,545 ****
          """
          def isTestMethod(attrname, testCaseClass=testCaseClass, prefix=self.testMethodPrefix):
!             return attrname[:len(prefix)] == prefix and callable(getattr(testCaseClass, attrname))
          testFnNames = filter(isTestMethod, dir(testCaseClass))
          for baseclass in testCaseClass.__bases__:
--- 541,545 ----
          """
          def isTestMethod(attrname, testCaseClass=testCaseClass, prefix=self.testMethodPrefix):
!             return attrname.startswith(prefix) and callable(getattr(testCaseClass, attrname))
          testFnNames = filter(isTestMethod, dir(testCaseClass))
          for baseclass in testCaseClass.__bases__:





More information about the Python-checkins mailing list