From 3d0dcd7f5af378d3ab6adb303b913e6c7b2e0ee5 Mon Sep 17 00:00:00 2001 From: Hasan Date: Sun, 17 Jan 2016 14:56:39 +0330 Subject: Refs #26022 -- Used context manager version of assertRaises in tests. --- tests/admin_utils/tests.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'tests/admin_utils') diff --git a/tests/admin_utils/tests.py b/tests/admin_utils/tests.py index 01ec6702cc..0da9143c19 100644 --- a/tests/admin_utils/tests.py +++ b/tests/admin_utils/tests.py @@ -221,10 +221,8 @@ class UtilsTests(SimpleTestCase): str("article") ) - self.assertRaises( - AttributeError, - lambda: label_for_field("unknown", Article) - ) + with self.assertRaises(AttributeError): + label_for_field("unknown", Article) def test_callable(obj): return "nothing" -- cgit v1.3