Re: Help with unittest2

2012-12-13 Thread Terry Reedy
On 12/13/2012 10:03 AM, Daniel Laird wrote: All, I am new to python and am stuck with python 2.6 (Ubuntu 10.04 and dont want to force switch to 2.7) You can altinstall 2.7 and leave the system 2.6 alone. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with unittest2

2012-12-13 Thread Paul Rudin
Thomas Bach writes: > BTW, I actually never used 'assertTypeEqual' I rather call assertEqual > and let unittest do the internals. I think assertEqual calls the right > method for you depending on the arguments type. The assertEqual methods have the advantage of checking the type of the argume

Re: Help with unittest2

2012-12-13 Thread Thomas Bach
Hi, On Thu, Dec 13, 2012 at 07:03:27AM -0800, Daniel Laird wrote: > I do am import unittest2 as unittest > The code does not fail but any use of the new functions results in: > NameError: global name 'assertListEqual' is not defined > > What am I doing wrong? Read the error message again: it say

Re: Help with unittest2

2012-12-13 Thread Dave Angel
On 12/13/2012 10:03 AM, Daniel Laird wrote: > All, > > I am new to python and am stuck with python 2.6 (Ubuntu 10.04 and dont want > to force switch to 2.7) > I want to use assertListEqual and other new test functions. > However > I do am import unittest2 as unittest > The code does not fail but a

Re: Help with unittest2

2012-12-13 Thread Boris FELD
How are you importing unittest2, do you have something like this ? try: import unittest2 as unittest except ImportError: import unittest If it's the case, you are maybe using default unittest while you think you are using unittest2. 2012/12/13 Daniel Laird : > On Thursday, December 13, 2012

Re: Help with unittest2

2012-12-13 Thread Daniel Laird
On Thursday, December 13, 2012 3:09:58 PM UTC, Miki Tebeka wrote: > On Thursday, December 13, 2012 7:03:27 AM UTC-8, Daniel Laird wrote: > > > I do am import unittest2 as unittest > > > NameError: global name 'assertListEqual' is not defined > > According to the docs > (http://docs.python.org/

Re: Help with unittest2

2012-12-13 Thread Miki Tebeka
On Thursday, December 13, 2012 7:03:27 AM UTC-8, Daniel Laird wrote: > I do am import unittest2 as unittest > NameError: global name 'assertListEqual' is not defined According to the docs (http://docs.python.org/2/library/unittest.html#unittest.TestCase.addTypeEqualityFunc) assertListEqual and f

Help with unittest2

2012-12-13 Thread Daniel Laird
All, I am new to python and am stuck with python 2.6 (Ubuntu 10.04 and dont want to force switch to 2.7) I want to use assertListEqual and other new test functions. However I do am import unittest2 as unittest The code does not fail but any use of the new functions results in: NameError: global n