diff --git a/lldb/test/API/api/log/TestAPILog.py b/lldb/test/API/api/log/TestAPILog.py index 72df276b06c3..d5a2e4857e53 100644 --- a/lldb/test/API/api/log/TestAPILog.py +++ b/lldb/test/API/api/log/TestAPILog.py @@ -19,20 +19,15 @@ class APILogTestCase(TestBase): """Test API logging""" logfile = self.getBuildArtifact("api-log.txt") - def cleanup(): - if os.path.exists(logfile): - os.unlink(logfile) - - if configuration.is_reproducer_replay(): - logfile = self.getReproducerRemappedPath(logfile) - - self.addTearDownHook(cleanup) self.expect("log enable lldb api -f {}".format(logfile)) self.dbg.SetDefaultArchitecture(None) self.dbg.GetScriptingLanguage(None) target = self.dbg.CreateTarget(None) + if configuration.is_reproducer_replay(): + logfile = self.getReproducerRemappedPath(logfile) + self.assertTrue(os.path.isfile(logfile)) with open(logfile, 'r') as f: log = f.read()