def list_tags(self): log.test_log.message(terminal.separator()) log.test_log.message('Listing all Test Tags.', bold=True) log.test_log.message(terminal.separator()) for tag in self.tags(): log.test_log.message(tag, machine_readable=True)
def list_tests(self): log.test_log.message(terminal.separator()) log.test_log.message('Listing all Test Cases.', bold=True) log.test_log.message(terminal.separator()) for suite in self.schedule: for test in suite: log.test_log.message(test.uid, machine_readable=True)
def load_tests(): ''' Create a TestLoader and load tests for the directory given by the config. ''' testloader = loader_mod.Loader() log.test_log.message(terminal.separator()) log.test_log.message('Loading Tests', bold=True) testloader.load_root(configuration.config.directory) return testloader
def _display_outcome(self, name, outcome, reason=None): print(self.color.Bold + SummaryHandler.colormap[outcome] + name + ' ' + state.Result.enums[outcome] + SummaryHandler.reset) if reason is not None: log.test_log.info('') log.test_log.info('Reason:') log.test_log.info(reason) log.test_log.info(terminal.separator('-'))
def run_schedule(test_schedule, log_handler): ''' Test Phases ----------- * Test Collection * Fixture Parameterization * Global Fixture Setup * Iteratevely run suites: * Suite Fixture Setup * Iteratively run tests: * Test Fixture Setup * Run Test * Test Fixture Teardown * Suite Fixture Teardown * Global Fixture Teardown ''' log_handler.schedule_finalized(test_schedule) log.test_log.message(terminal.separator()) log.test_log.message('Running Tests from {} suites'.format( len(test_schedule.suites)), bold=True) log.test_log.message("Results will be stored in {}".format( configuration.config.result_path)) log.test_log.message(terminal.separator()) # Build global fixtures and exectute scheduled test suites. if configuration.config.test_threads > 1: library_runner = runner.LibraryParallelRunner(test_schedule) library_runner.set_threads(configuration.config.test_threads) else: library_runner = runner.LibraryRunner(test_schedule) library_runner.run() failed = log_handler.unsuccessful() log_handler.finish_testing() return 1 if failed else 0
def list_suites(self): log.test_log.message(terminal.separator()) log.test_log.message('Listing all Test Suites.', bold=True) log.test_log.message(terminal.separator()) for suite in self.suites(): log.test_log.message(suite.uid, machine_readable=True)