示例#1
0
 def setUp(self):
   super(TestCase, self).setUp()
   util.setup_logging()
   tf.logging.set_verbosity(tf.logging.DEBUG)
   logging.getLogger('werkzeug').setLevel(logging.INFO)
   tf.logging.debug('=== %s ===', self._method)
   db.TESTING_MODE = True
示例#2
0
def setup_environment():
    """Makes recommended modifications to the environment.

  This functions changes global state in the Python process. Calling
  this function is a good idea, but it can't appropriately be called
  from library routines.
  """
    util.setup_logging()

    # The default is HTTP/1.0 for some strange reason. If we don't use
    # HTTP/1.1 then a new TCP socket and Python thread is created for
    # each HTTP request. The tradeoff is we must always specify the
    # Content-Length header, or do chunked encoding for streaming.
    serving.WSGIRequestHandler.protocol_version = 'HTTP/1.1'
示例#3
0
 def setUp(self):
     super(TestCase, self).setUp()
     util.setup_logging()
     logging.set_verbosity(logging.DEBUG)
     logger.debug('=== %s ===', self._method)
     db.TESTING_MODE = True