Exemplo n.º 1
0
 def test_dynamic_print_complex(self):
   try:
     out_capturer = six.StringIO()
     sys.stdout = out_capturer
     with self.test_session() as sess:
       sess.run(builtins.dynamic_print('test message', [1, 2]))
       self.assertEqual(out_capturer.getvalue(), 'test message [1, 2]\n')
   finally:
     sys.stdout = sys.__stdout__
Exemplo n.º 2
0
 def test_dynamic_print_tf(self):
     try:
         out_capturer = six.StringIO()
         sys.stdout = out_capturer
         with self.test_session() as sess:
             sess.run(builtins.dynamic_print('test message', 1))
             self.assertEqual(out_capturer.getvalue(), 'test message 1\n')
     finally:
         sys.stdout = sys.__stdout__