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

Dino Viehland dinov at exchange.microsoft.com
Tue Jan 24 22:43:21 CET 2006


Thanks for the bug report.  This is something that may be rather difficult to fix so I don't know that we'll get to it anytime too soon but it's good to track these little differences.


-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jones, Larry
Sent: Tuesday, January 24, 2006 7:35 AM
To: 'users at lists.ironpython.com'
Subject: [IronPython] Unit Test Failures Do Not Include String Arguments Passed to Test s

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_security\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
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.




More information about the Ironpython-users mailing list