def pytest_terminal_summary(self, terminalreporter): """ Add a section to terminal summary reporting. * When the `--disable-warnings` flag is active, removes all raised warnings prior to outputting the final console report. * When `--coverage` is active, outputs the result to stdout and saves the final report json. Arguments --------- terminalreporter : `_pytest.terminal.TerminalReporter` The internal terminal reporter object """ if self.config.getoption( "--disable-warnings") and "warnings" in terminalreporter.stats: del terminalreporter.stats["warnings"] if CONFIG.argv["coverage"]: terminalreporter.section("Coverage") # output coverage report to console coverage_eval = coverage.get_merged_coverage_eval() for line in output._build_coverage_output(coverage_eval): terminalreporter.write_line(line) # save coverage report as `reports/coverage.json` output._save_coverage_report( self.project._build, coverage_eval, self.project_path.joinpath(self.project._structure["reports"]), )
def _sessionfinish_coverage(self, coverage_eval): if CONFIG.argv["coverage"]: output._print_coverage_totals(self.project._build, coverage_eval) output._save_coverage_report( self.project._build, coverage_eval, self.project_path.joinpath(self.project._structure["reports"]), )
def pytest_sessionfinish(): manager.save_json() if ARGV["coverage"]: coverage_eval = brownie.test.coverage.get_merged_coverage_eval() output._print_coverage_totals(project._build, coverage_eval) output._save_coverage_report( project._build, coverage_eval, project._project_path.joinpath("reports")) if ARGV["gas"]: output._print_gas_profile() project.close(False)
def _sessionfinish_coverage(self, coverage_eval): if ARGV["coverage"]: output._print_coverage_totals(self.project._build, coverage_eval) output._save_coverage_report( self.project._build, coverage_eval, self.project_path.joinpath("reports") )