Skip to content

robot.testdoc

Module implementing the command line entry point for the Testdoc tool.

This module can be executed from the command line using the following approaches::

1
2
python -m robot.testdoc
python path/to/robot/testdoc.py

Instead of python it is possible to use also other Python interpreters.

This module also provides :func:testdoc and :func:testdoc_cli functions that can be used programmatically. Other code is for internal usage.

testdoc_cli

testdoc_cli(arguments)

Executes Testdoc similarly as from the command line.

:param arguments: command line arguments as a list of strings.

For programmatic usage the :func:testdoc function is typically better. It has a better API for that and does not call :func:sys.exit like this function.

Example::

1
2
3
from robot.testdoc import testdoc_cli

testdoc_cli(['--title', 'Test Plan', 'mytests', 'plan.html'])
Source code in src/robot/testdoc.py
def testdoc_cli(arguments):
    """Executes `Testdoc` similarly as from the command line.

    :param arguments: command line arguments as a list of strings.

    For programmatic usage the :func:`testdoc` function is typically better. It
    has a better API for that and does not call :func:`sys.exit` like
    this function.

    Example::

        from robot.testdoc import testdoc_cli

        testdoc_cli(['--title', 'Test Plan', 'mytests', 'plan.html'])
    """
    TestDoc().execute_cli(arguments)

testdoc

testdoc(*arguments, **options)

Executes Testdoc programmatically.

Arguments and options have same semantics, and options have same names, as arguments and options to Testdoc.

Example::

1
2
3
from robot.testdoc import testdoc

testdoc('mytests', 'plan.html', title='Test Plan')
Source code in src/robot/testdoc.py
def testdoc(*arguments, **options):
    """Executes `Testdoc` programmatically.

    Arguments and options have same semantics, and options have same names,
    as arguments and options to Testdoc.

    Example::

        from robot.testdoc import testdoc

        testdoc('mytests', 'plan.html', title='Test Plan')
    """
    TestDoc().execute(*arguments, **options)