def _handle_reports(self, report_manager, exec_results): if not report_manager.has_providers(): logging.debug('No providers were registered.') return for provider in report_manager.providers_names(): print('Writing {} report.'.format(provider)) for exec_result in exec_results: t_result = api.to_testresults( exec_result.notebook_result.exit_output) if t_result is None: print('Warning:') print( '\tThe output of {} is missing or the format is invalid.'. format(exec_result.notebook_path)) continue report_manager.add_result(exec_result.notebook_path, t_result) for file_name in report_manager.write(): print('File {} written'.format(file_name))
def test__to_testresults__non_pickle_output__none(mocker): output = 'NOT A PICKLE' result = nutter_api.to_testresults(output) assert result is None
def test__to_testresults__pickle_output__testresult(mocker): output = TestResults().serialize() result = nutter_api.to_testresults(output) assert isinstance(result, TestResults)
def test__to_testresults__none_output__none(mocker): output = None result = nutter_api.to_testresults(output) assert result is None