예제 #1
0
    def teardown_fixture(self, logger, abort=False):
        """
        Run a test that tears down the job's fixture.

        Return True if the teardown was successful, False otherwise.
        """

        # Refresh the fixture table before teardown to capture changes due to
        # CleanEveryN and stepdown hooks.
        self.report.logging_prefix = create_fixture_table(self.fixture)

        if abort:
            test_case = _fixture.FixtureAbortTestCase(
                self.test_queue_logger, self.fixture,
                "job{}".format(self.job_num), self.times_set_up)
            self.times_set_up += 1
        else:
            test_case = _fixture.FixtureTeardownTestCase(
                self.test_queue_logger, self.fixture,
                "job{}".format(self.job_num))

        test_case(self.report)
        if self.report.find_test_info(test_case).status != "pass":
            logger.error("The teardown of %s failed.", self.fixture)
            return False

        return True
예제 #2
0
파일: job.py 프로젝트: tomcucinotta/mongo
    def teardown_fixture(self, logger, abort=False):
        """
        Run a test that tears down the job's fixture.

        Return True if the teardown was successful, False otherwise.
        """
        if abort:
            test_case = _fixture.FixtureAbortTestCase(
                self.test_queue_logger, self.fixture,
                "job{}".format(self.job_num), self.times_set_up)
            self.times_set_up += 1
        else:
            test_case = _fixture.FixtureTeardownTestCase(
                self.test_queue_logger, self.fixture,
                "job{}".format(self.job_num))

        test_case(self.report)
        if self.report.find_test_info(test_case).status != "pass":
            logger.error("The teardown of %s failed.", self.fixture)
            return False

        return True