def test_findFileWithImportError(self):
        """
        findByName will re-raise ImportErrors inside modules that it has found
        and imported.
        """
        self.assertRaises(
            ImportError, self.loader.findByName,
            "unimportablepackage.test_module"
        )

        findByName will re-raise ImportErrors inside modules that it has found
        and imported.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/test/test_loader.py