diff -r 815b88454e3e Lib/test/test_importlib/builtin/test_loader.py --- a/Lib/test/test_importlib/builtin/test_loader.py Fri Aug 31 17:14:31 2012 -0400 +++ b/Lib/test/test_importlib/builtin/test_loader.py Sat Sep 01 01:25:03 2012 +0100 @@ -92,7 +92,6 @@ method = getattr(machinery.BuiltinImporter, meth_name) with self.assertRaises(ImportError) as cm: method(builtin_util.BAD_NAME) - self.assertRaises(builtin_util.BAD_NAME) diff -r 815b88454e3e Lib/unittest/case.py --- a/Lib/unittest/case.py Fri Aug 31 17:14:31 2012 -0400 +++ b/Lib/unittest/case.py Sat Sep 01 01:25:03 2012 +0100 @@ -567,6 +567,17 @@ the_exception = cm.exception self.assertEqual(the_exception.error_code, 3) """ + def check_is_exception(e): + if not type(e) is type or not issubclass(e, BaseException): + raise TypeError('assertRaises arg 1 must be an exception type ' + 'or tuple of exception types') + + if type(excClass) is tuple: + for e in excClass: + check_is_exception(e) + else: + check_is_exception(excClass) + context = _AssertRaisesContext(excClass, self, callableObj) return context.handle('assertRaises', callableObj, args, kwargs) diff -r 815b88454e3e Lib/unittest/test/test_case.py --- a/Lib/unittest/test/test_case.py Fri Aug 31 17:14:31 2012 -0400 +++ b/Lib/unittest/test/test_case.py Sat Sep 01 01:25:03 2012 +0100 @@ -1027,6 +1027,27 @@ self.assertIsInstance(e, ExceptionMock) self.assertEqual(e.args[0], v) + def testAssertRaisesNoExceptionType(self): + ctx = self.assertRaises(TypeError) + with ctx: + self.assertRaises(1) + self.assertIsInstance(ctx.exception, TypeError) + + ctx = self.assertRaises(TypeError) + with ctx: + self.assertRaises(object) + self.assertIsInstance(ctx.exception, TypeError) + + ctx = self.assertRaises(TypeError) + with ctx: + self.assertRaises((TypeError, 1)) + self.assertIsInstance(ctx.exception, TypeError) + + ctx = self.assertRaises(TypeError) + with ctx: + self.assertRaises((object, 1)) + self.assertIsInstance(ctx.exception, TypeError) + def testAssertWarnsCallable(self): def _runtime_warn(): warnings.warn("foo", RuntimeWarning) diff -r 815b88454e3e Misc/ACKS --- a/Misc/ACKS Fri Aug 31 17:14:31 2012 -0400 +++ b/Misc/ACKS Sat Sep 01 01:25:03 2012 +0100 @@ -1102,6 +1102,7 @@ Frank Visser Johannes Vogel Sjoerd de Vries +Daniel Wagner-Hall Niki W. Waibel Wojtek Walczak Charles Waldman