From: Morgan Richomme Date: Fri, 9 Dec 2016 18:46:54 +0000 (+0100) Subject: Snaps integration X-Git-Tag: 0.2~1033 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=14f2b4917411bb24a03f04a210627f144873a995;p=functest-xtesting.git Snaps integration Fix testcase class name Minor change on criteria, start_time, stop_time Change-Id: I9ba49781c3a3212f03b7ab822f9ab311a4fafd3d Signed-off-by: Morgan Richomme --- diff --git a/functest/core/pytest_suite_runner.py b/functest/core/pytest_suite_runner.py index ba372c3b..2d5b2667 100644 --- a/functest/core/pytest_suite_runner.py +++ b/functest/core/pytest_suite_runner.py @@ -7,12 +7,12 @@ # # http://www.apache.org/licenses/LICENSE-2.0 -from functest.core import TestCasesBase +import testcase_base as base import unittest import time -class PyTestSuiteRunner(TestCasesBase.TestCasesBase): +class PyTestSuiteRunner(base.TestcaseBase): """ This superclass is designed to execute pre-configured unittest.TestSuite() objects @@ -25,9 +25,9 @@ class PyTestSuiteRunner(TestCasesBase.TestCasesBase): """ Starts test execution from the functest framework """ - start_time = time.time() + self.start_time = time.time() result = unittest.TextTestRunner(verbosity=2).run(self.suite) - end_time = time.time() + self.stop_time = time.time() if result.errors: self.logger.error('Number of errors in test suite - ' + @@ -45,12 +45,11 @@ class PyTestSuiteRunner(TestCasesBase.TestCasesBase): or (result.failures and len(result.failures) > 0): self.logger.info("%s FAILED" % self.case_name) self.criteria = 'FAIL' - exit_code = TestCasesBase.TestCasesBase.EX_RUN_ERROR + exit_code = base.TestcaseBase.EX_RUN_ERROR else: self.logger.info("%s OK" % self.case_name) - exit_code = TestCasesBase.TestCasesBase.EX_OK + exit_code = base.TestcaseBase.EX_OK + self.criteria = 'PASS' - self.details = {'timestart': start_time, - 'duration': round(end_time - start_time, 1), - 'status': self.criteria} + self.details = {} return exit_code