avise.reportgen.reporters

avise.reportgen.reporters.base

Base class for report writers.

Reporters handle writing the final report from ReportData to different file formats (JSON, HTML, MD)

class avise.reportgen.reporters.base.BaseReporter[source]

Bases: ABC

Base class for report writers.

Each reporter handles a specific output format (JSON, HTML, MD).

static escape_html(text: str) str[source]

Helper method for escaping special HTML characters. Done to prevent possibly malicious outputs from the SETs from causing problems when rendering HTML

file_extension: str = ''
format_name: str = ''
abstractmethod write(report_data: ReportData, output_path: Path) None[source]

Write report data to a file.

Parameters:
  • report_data – The report data to write

  • output_path – Path to the output file / directory

avise.reportgen.reporters.html_reporter

HTML report writer.

class avise.reportgen.reporters.html_reporter.HTMLReporter[source]

Bases: BaseReporter

Writes reports in styled HTML format.

STATUS_COLORS = {'error': '#ffc107', 'failed': '#dc3545', 'passed': '#28a745'}
file_extension: str = '.html'
format_name: str = 'html'
group_results: bool = True
write(report_data: ReportData, output_path: Path) None[source]

Write report data as styled HTML file.

Parameters:
  • report_data – The report data to write

  • output_path – Path to the output file / directory

avise.reportgen.reporters.json_reporter

JSON report writer.

class avise.reportgen.reporters.json_reporter.JSONReporter[source]

Bases: BaseReporter

Writes reports in JSON format.

file_extension: str = '.json'
format_name: str = 'json'
write(report_data: ReportData, output_path: Path) None[source]

Write report data as JSON file.

Parameters:
  • report_data – The report data to write

  • output_path – Path to the output file / directory

avise.reportgen.reporters.markdown_reporter

Markdown report writer.

class avise.reportgen.reporters.markdown_reporter.MarkdownReporter[source]

Bases: BaseReporter

Writes reports in Markdown (MD) format.

file_extension: str = '.md'
format_name: str = 'markdown'
group_results: bool = True
write(report_data: ReportData, output_path: Path) None[source]

Write report data as Markdown file.

Parameters:
  • report_data – The report data to write

  • output_path – Path to the output file / directory