def test_remove(self): try: fo = FileObject("test", temporary=True) fo.remove() if os.path.exists(fo.path): raise Exception("File has not been removed") except Exception as exc: traceback.print_exc() self.fail(exc)