def tearDown(self): super(DocFileCase, self).tearDown() if self._result_var is not None: sys.displayhook = self._old_displayhook delattr(builtin_mod, self._result_var)