[Patches] [ python-Patches-819077 ] fix import problem(unittest.py)

SourceForge.net noreply at sourceforge.net
Sun Oct 26 05:41:11 EST 2003


Patches item #819077, was opened at 2003-10-07 09:23
Message generated for change (Comment added) made by purcell
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=819077&group_id=5470

Category: Library (Lib)
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: George Yoshida (quiver)
Assigned to: Steve Purcell (purcell)
Summary: fix import problem(unittest.py)

Initial Comment:
This patch includes 3 changes to unittest.py.

* Don't import unittest.(important)
  unittest is imported in the original script.
  This can be the cause of trouble.

* cast float (trivial)
  TextTestRunner.run() method has the line as 
follows:
  timeTaken = float(stopTime - startTime)

  However, time.time() returns the time by a 
floating point number by default.
  So you don't need to cast the value to a float.

* fix typo (trivial)
  """Note that decimal places (from zero) is 
usually ..."""

  'is' should be 'are'.


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

>Comment By: Steve Purcell (purcell)
Date: 2003-10-26 11:41

Message:
Logged In: YES 
user_id=21477

Thanks George! 
 
At some point in the distant past I believe it was necessary to import 
'unittest', otherwise the 'TestCase' that a module saw was not the same 
as the 'TestCase' seen within 'unittest', and the user's TestCase 
subclasses were not recognised as subclasses of the TestCase seen 
within unittest. I see no evidence that this is the case now, so I'm 
incorporating this and your other 2 changes. 

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

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



More information about the Patches mailing list