示例#1
0
文件: target.py 项目: leshibily/iris2
    def pytest_sessionfinish(self, session):
        """ called after whole test run finished, right before returning the exit status to the system.

        :param _pytest.main.Session session: the pytest session object.
        :param int exitstatus: the status which pytest will return to the system.
        """
        self.end_time = time.time()

        update_run_index(self, True)
        footer = create_footer(self)
        result = footer.print_report_footer()
        create_run_log(self)

        logger.info('\n' + 'Test session {} complete'.format(
            session.name).center(os.get_terminal_size().columns, '-'))

        if core_args.email:
            submit_email_report(self, result)
示例#2
0
文件: target.py 项目: omnarayan/iris
    def pytest_sessionstart(self, session):
        """Called after the 'Session' object has been created and before performing test collection.

        :param _pytest.main.Session session: the pytest session object.
        """
        self.start_time = time.time()
        logger.info('\n' + 'Test session {} started'.format(session.name).center(os.get_terminal_size().columns, '-'))

        core_settings_list = []
        for arg in vars(core_args):
            core_settings_list.append('{}: {}'.format(arg, getattr(core_args, arg)))
        logger.info('\nIris settings:\n' + ', '.join(core_settings_list))

        target_settings_list = []

        for arg in vars(self.args):
            target_settings_list.append('{}: {}'.format(arg, getattr(self.args, arg)))
        logger.info(('\n{} settings:\n' +
                     ', '.join(target_settings_list)).format(str(core_args.target).capitalize()))
        update_run_index(self, False)