diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index 386ec61126b..10b32d35d11 100644 --- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -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