[Patches] [ python-Patches-418489 ] unittest string format error

noreply@sourceforge.net noreply@sourceforge.net
Wed, 09 May 2001 18:31:35 -0700


Patches item #418489, was updated on 2001-04-23 23:58
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=418489&group_id=5470

Category: library
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Andrew Dalke (dalke)
Assigned to: Steve Purcell (purcell)
Summary: unittest string format error

Initial Comment:
unittest.loadTestsFromName has a string format error
of the form - it needs some parens.  Currently is:

 raise ValueError, \
    "calling %s returned %s, not a test" % obj,test

should be

 raise ValueError, \
   "calling %s returned %s, not a test" % (obj,test)

Let's see if this really will let me upload a patch.

Index: unittest.py
=======================================================
============
RCS 
file: /cvsroot/python/python/dist/src/Lib/unittest.py,v
retrieving revision 1.7
diff -c -r1.7 unittest.py
*** unittest.py 2001/04/15 09:18:32     1.7
--- unittest.py 2001/04/24 06:57:32
***************
*** 443,449 ****
              if not isinstance(test, TestCase) and \
                 not isinstance(test, TestSuite):
                  raise ValueError, \
!                       "calling %s returned %s, not a 
test" % obj,test
              return test
          else:
              raise ValueError, "don't know how to 
make test from: %s" % obj
--- 443,449 ----
              if not isinstance(test, TestCase) and \
                 not isinstance(test, TestSuite):
                  raise ValueError, \
!                       "calling %s returned %s, not a 
test" % (obj, test)
              return test
          else:
              raise ValueError, "don't know how to 
make test from: %s" % obj


----------------------------------------------------------------------

>Comment By: Steve Purcell (purcell)
Date: 2001-05-09 18:31

Message:
Logged In: YES 
user_id=21477

Thanks Andrew.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=418489&group_id=5470