stestr last Command

Show the last run loaded into a repository.

class stestr.commands.last.Last(app, app_args, cmd_name=None)[source]

Show the last run loaded into a repository.

Failing tests are shown on the console and a summary of the run is printed at the end.

Without –subunit, the process exit code will be non-zero if the test run was not successful. With –subunit, the process exit code is non-zero only if the subunit stream could not be generated successfully. The test results and run status are included in the subunit stream, so the stream should be used to determining the result of the run instead of the exit code when using the –subunit flag.

get_parser(prog_name)[source]

Return an argparse.ArgumentParser.

take_action(parsed_args)[source]

Override to do something useful.

The returned value will be returned by the program.

stestr.commands.last.last(repo_url=None, subunit_out=False, pretty_out=True, color=False, stdout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>, suppress_attachments=False, all_attachments=False, show_binary_attachments=False)[source]

Show the last run loaded into a a repository

This function will print the results from the last run in the repository to STDOUT. It can optionally print the subunit stream for the last run to STDOUT if the subunit option is set to true.

Note this function depends on the cwd for the repository if repo_url is not specified it will use the repository located at CWD/.stestr

Parameters:
  • repo_url (str) – The url of the repository to use.
  • subunit_out (bool) – Show output as a subunit stream.
  • pretty_out – Use the subunit-trace output filter.
  • color – Enable colorized output with the subunit-trace output filter.
  • subunit (bool) – Show output as a subunit stream.
  • stdout (file) – The output file to write all output to. By default this is sys.stdout
  • suppress_attachments (bool) – When set true attachments subunit_trace will not print attachments on successful test execution.
  • all_attachments (bool) – When set true subunit_trace will print all text attachments on successful test execution.
  • show_binary_attachments (bool) – When set to true, subunit_trace will print binary attachments in addition to text attachments.
Return return_code:
 

The exit code for the command. 0 for success and > 0 for failures.

Return type:

int