def testDisableTracingWorks(self): writer = dumping_callback.enable_dumping(self.dump_root) dumping_callback.disable_dumping() x = constant_op.constant([10.0, 12.0, 10.0]) for _ in range(2): array_ops.unique(x) writer.FlushNonExecutionFiles() writer.FlushExecutionFiles() reader = debug_events_reader.DebugEventsDir(self.dump_root) source_files_iter = reader.source_files_iterator() stack_frames_iter = reader.stack_frames_iterator() execution_iter = reader.execution_iterator() # No source-file, stack-frame or execution data should have been dumped. with self.assertRaises(StopIteration): next(source_files_iter) with self.assertRaises(StopIteration): next(stack_frames_iter) with self.assertRaises(StopIteration): next(execution_iter)
def testDisablingTracingCallbackWithoutEnablingFirstIsTolerated(self): dumping_callback.disable_dumping()
def tearDown(self): if os.path.isdir(self.dump_root): shutil.rmtree(self.dump_root, ignore_errors=True) dumping_callback.disable_dumping() super(TracingCallbackTest, self).tearDown()
def tearDown(self): if os.path.isdir(self.dump_root): shutil.rmtree(self.dump_root, ignore_errors=True) check_numerics_callback.disable_check_numerics() dumping_callback.disable_dumping() super(DumpingCallbackTestBase, self).tearDown()