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 name 'assertListEqual' is not defined

What am I doing wrong?
Do I need to change something else? The docs seem to imply what I have done is 
enough.

Hope you can help
Cheers
Dan L
-- 
http://mail.python.org/mailman/listinfo/python-list


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/2/library/unittest.html#unittest.TestCase.addTypeEqualityFunc)
>  assertListEqual and friends was added in 2.7.
> 
> 
> 
> You can use assertEuqal, or if you don't care about order 
> assertEqual(sorted(a), sorted(b)).

Thanks, however I thought by using unittest2 it added the new 2.7 features to 
2.6?
-- 
http://mail.python.org/mailman/listinfo/python-list