[IronPython] Unit Test Failures Do Not Include String Arguments Passed to Test s

Jones, Larry Larry.Jones at aspentech.com
Tue Jan 24 16:35:09 CET 2006


The following script
 
import unittest
 

class MyTest(unittest.TestCase):
 
    def testFirst(self):
        self.failUnless(False, 'first')
 
    def testSecond(self):
        self.failIf(False, 'second')
 

def suite():
    theSuite = unittest.makeSuite(MyTest, 'test')
    return theSuite;
 
if __name__ == '__main__':
    unittest.TextTestRunner().run(suite())
    
 
produces the following output in Python 2.4
 
$ python unittesterror.py
F.
======================================================================
FAIL: testFirst (__main__.MyTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "unittesterror.py", line 7, in testFirst
    self.failUnless(False, 'first')
AssertionError: first
 
----------------------------------------------------------------------
Ran 2 tests in 0.000s
 
FAILED (failures=1)
 
(In particular, it contains the text 'first' supported to the assertion.)
 
Executing under IronPython, the output is:
 
$ /usr/local/bin/ironpython/IronPythonConsole.exe unittesterror.py
F.
======================================================================
FAIL: testFirst (__main__.MyTest)
----------------------------------------------------------------------
<type 'AssertionError'>: IronPython.Runtime.PythonAssertionError:
AssertionError
   at IronPython.Runtime.Ops.Raise(Object type, Object value, Object
traceback)
   at unittest.failUnless$f32(Object self, Object expr, Object msg) in
c:\Python24\Lib\unittest.py:line 309
   at IronPython.Runtime.Function3.Call(Object arg0, Object arg1, Object
arg2)
   at IronPython.Runtime.Ops.Call(Object func, Object arg0, Object arg1,
Object arg2)
   at IronPython.Runtime.Method.Call(Object arg0, Object arg1)
   at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object
func, Object arg0, Object arg1)
   at __main__.testFirst$f0(Object self) in
c:\usr\home\jonesl\Employee\Current\ProductDir\ResearchAndDevelopment\als_se
curity\p
roto_azn\unittesterror.py:line 7
   at IronPython.Runtime.Function1.Call(Object arg0)
   at IronPython.Runtime.Ops.Call(Object func, Object arg0)
   at IronPython.Runtime.Method.Call()
   at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object
func)
   at unittest.run$f26(Object self, Object result) in
c:\Python24\Lib\unittest.py:line 260
 
----------------------------------------------------------------------
Ran 2 tests in 0.172s
 
FAILED (failures=1)
 
In particular, the string argument is not present in the output.
 
I have submitted this behavior as a bug.
 

--

Lawrence Allan Jones
Senior Developer / Technical Advisor
Aspen Technology, Inc.
2500 CityWest Blvd. Suite 1500
Houston, Texas 77042
USA
281-504-3324 (work)
281-504-3395 (fax)
larry.jones at aspentech.com <mailto:larry.jones at aspentech.com> 
www.aspentech.com <http://www.aspentech.com/> 

  <http://www.aspentech.com/signature/email_2_03.gif> 
  <http://www.aspentech.com/signature/email_2_04.gif> 	
 
This e-mail and any attachments are intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information. If you are not the intended recipient of this
e-mail, you are hereby notified any dissemination, distribution or copying
of this email, and any attachments thereto, is strictly prohibited. If you
receive this email in error please immediately notify the sender and
permanently delete the original copy and any copy of any e-mail, and any
printout thereof.
    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060124/facfe994/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: email_2_03.gif
Type: image/gif
Size: 2078 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060124/facfe994/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: email_2_04.gif
Type: image/gif
Size: 200 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060124/facfe994/attachment-0001.gif>


More information about the Ironpython-users mailing list