def test_bad_magic(self):

    def test(name, mapping, bytecode_path):
        with self.assertRaises(ImportError) as cm:
            self.import_(bytecode_path, name)
        self.assertEqual(cm.exception.name, name)
        self.assertEqual(cm.exception.path, bytecode_path)
    self._test_bad_magic(test, del_source=True)
def test_bad_magic(self):

    def test(name, mapping, bytecode_path):
        with self.assertRaises(ImportError) as cm:
            self.import_(bytecode_path, name)
        self.assertEqual(cm.exception.name, name)
        self.assertEqual(cm.exception.path, bytecode_path)
    self._test_bad_magic(test, del_source=True)