[IronPython] False? with Unit Test

Dave Fugate dfugate at microsoft.com
Mon Apr 7 17:47:55 CEST 2008

Thanks for reporting this!  I believe we do already have an internal bug report on this, and I've now created a public bug on CodePlex (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=15972) so it can be voted on.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher
Sent: Saturday, April 05, 2008 10:16 AM
To: Discussion of IronPython
Subject: Re: [IronPython] False? with Unit Test

It's the call to sys.exit that does this.

There's a subtle difference between IronPython 2.0B1 and CPython 2.5 when sys.exit is called with a boolean parameter.  CPython doesn't print the value of the parameter if it's boolean, while IronPython does.  Presumably, CPython does this for backwards compatibility with a time when it didn't have a boolean data type. I'd guess that sys.exit(False) gets the same behavior as sys.exit(0) while sys.exit(True) is the same as sys.exit(1).  But I haven't checked the CPython source to confirm that guess.
On Sat, Apr 5, 2008 at 6:06 AM, Davy Mitchell <daftspaniel at gmail.com<mailto:daftspaniel at gmail.com>> wrote:
Hello List,

Found a little funny on the latest IPY.

    import unittest

    class ATest(unittest.TestCase):
        def setUp(self):
            self.pop = ""
        def test_blog(self):
            print "test"

    if __name__ == '__main__':

Runs fine but under IPY there's a extra line with 'False' output:

Ran one test in 0.096s


Anyone had more experience with this module?


Davy Mitchell
Blog - http://www.latedecember.co.uk/sites/personal/davy/
Twitter - http://twitter.com/daftspaniel
Skype - daftspaniel http://needgod.com
Users mailing list
Users at lists.ironpython.com<mailto:Users at lists.ironpython.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080407/1753cacf/attachment.html>

More information about the Ironpython-users mailing list