Home | History | Annotate | Download | only in util

Lines Matching refs:captured

33 def reroute_error(captured):
34 """Temporarily reroute errors written to tf_logging.error into `captured`."""
35 del captured[:]
38 captured.extend(args)
51 captured = []
52 with reroute_error(captured):
57 self.assertIn('Object was never used', '\n'.join(captured))
58 self.assertIn('blah0:0', '\n'.join(captured))
59 self.assertIn('in_this_function', '\n'.join(captured))
65 captured = []
66 with reroute_error(captured):
70 self.assertNotIn('Object was never used', '\n'.join(captured))
71 self.assertNotIn('%s:0' % name, '\n'.join(captured))
94 captured = []
95 with reroute_error(captured):
97 self.assertIn('Object was never used', '\n'.join(captured))
98 self.assertIn('blah2:0', '\n'.join(captured))
99 self.assertIn('return_const', '\n'.join(captured))
108 captured = []
109 with reroute_error(captured):
116 self.assertIn('Object was never used', '\n'.join(captured))
117 self.assertIn('blah3:0', '\n'.join(captured))
118 self.assertIn('return_const', '\n'.join(captured))