On Saturday 11 September 2010, it occurred to Vito 'ZeD' De Tullio to exclaim: > from http://docs.python.org/library/unittest.html > > $ python test_unittest.py > .E. > ====================================================================== > ERROR: test_sample (__main__.TestSequenceFunctions) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "./test_data_manip.py", line 23, in test_sample > with self.assertRaises(ValueError): > TypeError: failUnlessRaises() takes at least 3 arguments (2 given) > > ---------------------------------------------------------------------- > Ran 3 tests in 0.001s > > FAILED (errors=1) > $
Which Python version are you using? To quote the docs you linked: http://docs.python.org/library/unittest.html#unittest.TestCase.assertRaises """ Changed in version 2.7: Added the ability to use assertRaises() as a context manager. """ Are you using Python 2.7 (or 3.x)?
-- http://mail.python.org/mailman/listinfo/python-list