# stestr load Command

Load data into a repository.

class `stestr.commands.load.``Load`(app, app_args, cmd_name=None)

  Load a subunit stream into a repository.

  Failing tests are shown on the console and a summary of the stream 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 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)

    Return an `argparse.ArgumentParser`.

  `take_action`(parsed_args)

    Override to do something useful.

    The returned value will be returned by the program.

`stestr.commands.load.``load`(force_init=False, in_streams=None, partial=False, subunit_out=False, repo_type='file', repo_url=None, run_id=None, streams=None, pretty_out=False, color=False, stdout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, abbreviate=False, suppress_attachments=False, serial=False, all_attachments=False, show_binary_attachments=False)

  Load subunit streams into a repository

  This function will load subunit streams into the repository. It will output to STDOUT the results from the input stream. Internally this is used by the run command to both output the results as well as store the result in the repository.

  Parameters:

  - force_init (bool) – Initialize the specified repository if it hasn’t been created.
  - in_streams (list) – A list of file objects that will be saved into the repository
  - partial (bool) – DEPRECATED: Specify the input is a partial stream. This option is deprecated and no longer does anything. It will be removed in the future.
  - subunit_out (bool) – Output the subunit stream to stdout
  - repo_type (str) – This is the type of repository to use. Valid choices are ‘file’ and ‘sql’.
  - repo_url (str) – The url of the repository to use.
  - run_id – The optional run id to save the subunit stream to.
  - streams (list) – A list of file paths to read for the input streams.
  - pretty_out (bool) – Use the subunit-trace output filter for the loaded stream.
  - color (bool) – Enabled colorized subunit-trace output
  - stdout (file) – The output file to write all output to. By default this is sys.stdout
  - abbreviate (bool) – Use abbreviated output if set true
  - 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