group

Run code inside a group. Groups are used to organize results in a test.

group(name, function)

Run the indicated function inside a group with the given name.

Parameters:
  • name (str) – the name of the group

  • function (Callable) – the code to run

Return type:

Any

Returns:

whatever the function returns

Usage:

load("group", "group")
load("requests", "get")

def default(_):
     group("visit product listing page", lambda: ...)

     def _add():
         ...

     group("add several products to the shopping cart", _add)