Module f.util

Part of fixture

Fixture utilties.
Class DataTestCase A mixin to use with unittest.TestCase.
Class ObjRegistry registers objects by class.
Function with_debug A nose decorator calls start_debug/start_debug before and after the
Function start_debug A shortcut to start logging a channel to a stream.
Function stop_debug The reverse of start_debug().
Class _dummy_stream Undocumented
Function _mklog returns a log object that does nothing until something adds a
def with_debug(*channels, **kw):
A nose decorator calls start_debug/start_debug before and after the decorated method.

All positional arguments are considered channels that should be debugged. Keyword arguments are passed to start_debug()

def start_debug(channel, stream=sys.stdout, handler=None):

A shortcut to start logging a channel to a stream.

For example:

>>> from fixture.util import start_debug, stop_debug
>>> start_debug("fixture.loadable")

starts logging messages from the fixture.loadable channel to the stream. Then...

>>> stop_debug("fixture.loadable")

...turns it off.

Available Channels

  • fixture.loadable
    • logs LOAD and CLEAR messages, referring to dataset actions
  • fixture.loadable.tree
    • logs a tree view of datasets loaded by datasets (recursion)

Keyword Arguments

  • stream
    • stream to create a loggin.StreamHandler with. defaults to stdout
  • handler
    • a preconfigured handler to add to the log
def stop_debug(channel):
The reverse of start_debug().
def _mklog(channel, default_level=logging.INFO, default_stream=None):
returns a log object that does nothing until something adds a useful handler to it
API Documentation for fixture, generated by pydoctor.