Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 1.72 KB

custom_output_handlers.rst

File metadata and controls

57 lines (36 loc) · 1.72 KB

Adding Custom Output Handlers

Third Party Output Handlers

  • rotest_reportportal
    • Plugin to the amazing Report Portal system, that enables viewing test results and investigating them.
  • rotest-progress
    • Uses tqdm to give you two user-friendly output handlers (tested on Linuex only): full_progress which shows the general progress of the run, and progress which shows the progress of the current component and can be used with other handlers that write to the screen, e.g. logdebug.

How to Make Your Own Output Handler

You can make your own Output Handler, following the next two steps:

  • Inheriting from rotest.core.result.handlers.abstract_handler.AbstractResultHandler, and overriding the relevant methods.
  • Register the above inheriting class as an entrypoint in your setup.py file inside setup():

    entry_points={
        "rotest.result_handlers":
            ["<handler tag, e.g. my_handler> = <import path to the monitor's module>:<monitor class name>"]
    },
  • Make sure it's being installed in the environment by calling

    python setup.py develop

For an example, you can refer to rotest_reportportal plugin.

Available Events

The available methods of an output handler:

rotest.core.result.handlers.abstract_handler.AbstractResultHandler