]> granicus.if.org Git - python/commitdiff
condense
authorBenjamin Peterson <benjamin@python.org>
Sat, 30 Oct 2010 23:04:49 +0000 (23:04 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sat, 30 Oct 2010 23:04:49 +0000 (23:04 +0000)
Lib/test/test_import.py

index 386ec61126be4adb06758285ea30f17c9b303658..10b32d35d11a1dd5e2afc45f2fbe88654adea42c 100644 (file)
@@ -36,12 +36,8 @@ class ImportTests(unittest.TestCase):
     def test_case_sensitivity(self):
         # Brief digression to test that import is case-sensitive:  if we got
         # this far, we know for sure that "random" exists.
-        try:
+        with self.assertRaises(ImportError):
             import RAnDoM
-        except ImportError:
-            pass
-        else:
-            self.fail("import of RAnDoM should have failed (case mismatch)")
 
     def test_double_const(self):
         # Another brief digression to test the accuracy of manifest float