Public Member Functions | Public Attributes
tornado.testing.ExpectLog Class Reference

List of all members.

Public Member Functions

def __enter__
def __exit__
def __init__
def filter

Public Attributes

 logger
 matched
 regex
 required

Detailed Description

Context manager to capture and suppress expected log output.

Useful to make tests of error conditions less noisy, while still
leaving unexpected log entries visible.  *Not thread safe.*

Usage::

    with ExpectLog('tornado.application', "Uncaught exception"):
        error_response = self.fetch("/some_page")

Definition at line 562 of file testing.py.


Constructor & Destructor Documentation

def tornado.testing.ExpectLog.__init__ (   self,
  logger,
  regex,
  required = True 
)
Constructs an ExpectLog context manager.

:param logger: Logger object (or name of logger) to watch.  Pass
    an empty string to watch the root logger.
:param regex: Regular expression to match.  Any log entries on
    the specified logger that match this regex will be suppressed.
:param required: If true, an exeption will be raised if the end of
    the ``with`` statement is reached without matching any log entries.

Definition at line 573 of file testing.py.


Member Function Documentation

Definition at line 597 of file testing.py.

def tornado.testing.ExpectLog.__exit__ (   self,
  typ,
  value,
  tb 
)

Definition at line 600 of file testing.py.

def tornado.testing.ExpectLog.filter (   self,
  record 
)

Definition at line 590 of file testing.py.


Member Data Documentation

Definition at line 581 of file testing.py.

Definition at line 581 of file testing.py.

Definition at line 581 of file testing.py.

Definition at line 581 of file testing.py.


The documentation for this class was generated from the following file:


rosbridge_server
Author(s): Jonathan Mace
autogenerated on Wed Sep 13 2017 03:18:21