Welcome to report documentation!

report (Report Module)

Author:

Description:

The Module is designed to help with python logging and to support some handlers for logging to memory.

Submodules:

Unittest:

See also the unittest documentation.

report.DEFAULT_FMT = '%(asctime)s: %(levelname)8s - %(name)s - %(message)s\n                                    File "%(pathname)s", line %(lineno)d, in %(funcName)s'

The default formatstring

report.JOURNAL_FMT = '%(levelname)8s - %(name)s - %(message)s'

A short journal formatter including the most important information

class report.JsonFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)
format(record)

Format the specified record as text.

The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.

report.LONG_FMT = '%(asctime)s: %(levelname)8s - %(name)s - %(message)s\n                                    File "%(pathname)s", line %(lineno)d, in %(funcName)s'

A long formatter which results in links to the source code inside Eclipse

report.SHORT_FMT = '%(asctime)s: %(levelname)8s - %(name)s - %(message)s'

A short formatter including the most important information

report.TCEL_FULL = 90

Testcase level (full), this is a complete test for the full functionality

report.TCEL_NAMES = {0: 'Single Test', 10: 'Smoke Test (Minumum subset)', 50: 'Short Test (Subset)', 90: 'Full Test (all defined tests)'}

Dictionary for resolving the test case levels (TCL) to a (human readable) name

report.TCEL_REVERSE_NAMED = {'full': 90, 'short': 50, 'single': 0, 'smoke': 10}

Dictionary for resolving named test case levels (TCL) to test case level number

report.TCEL_SHORT = 50

Testcase level (short), this is a short test for an extended functionality

report.TCEL_SINGLE = 0

Testcase level (smoke), this is just a rough test for the main functionality

report.TCEL_SMOKE = 10

Testcase level (smoke), this is just a rough test for the main functionality

report.app_logging_config()

For details see comment in default_logging_config.

class report.collectingHandler
emit(record)

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

class report.collectingRingHandler(max_logs=None)
class report.collectingTestcaseHandler
emit(record)

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

report.default_logging_config(fmt='%(levelname)8s - %(name)s - %(message)s')

You are able to configure logging by a config file including these line:

import logging

DEBUG = False # # Logging # APP_NAME = “<YOUR_APP_NAME>” LOG_HOSTNAME = “loggy” # When DEBUG is True LOG_LEVEL = logging.INFO # STDOUT logging

class report.testSession(module_names=[], **kwargs)

Indices and tables