diff options
Diffstat (limited to 'meta/lib/oeqa/core/decorator/depends.py')
-rw-r--r-- | meta/lib/oeqa/core/decorator/depends.py | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/meta/lib/oeqa/core/decorator/depends.py b/meta/lib/oeqa/core/decorator/depends.py index baa04341c7..33f0841cab 100644 --- a/meta/lib/oeqa/core/decorator/depends.py +++ b/meta/lib/oeqa/core/decorator/depends.py @@ -1,9 +1,11 @@ +# # Copyright (C) 2016 Intel Corporation -# Released under the MIT license (see COPYING.MIT) +# +# SPDX-License-Identifier: MIT +# from unittest import SkipTest -from oeqa.core.threaded import OETestRunnerThreaded from oeqa.core.exception import OEQADependency from . import OETestDiscover, registerDecorator @@ -64,19 +66,15 @@ def _order_test_case_by_depends(cases, depends): return [cases[case_id] for case_id in cases_ordered] def _skipTestDependency(case, depends): - if isinstance(case.tc.runner, OETestRunnerThreaded): - import threading - results = case.tc._results[threading.get_ident()] - else: - results = case.tc._results - - skipReasons = ['errors', 'failures', 'skipped'] - - for reason in skipReasons: - for test, _ in results[reason]: - if test.id() in depends: - raise SkipTest("Test case %s depends on %s and was in %s." \ - % (case.id(), test.id(), reason)) + for dep in depends: + found = False + for test, _ in case.tc.results.successes: + if test.id() == dep: + found = True + break + if not found: + raise SkipTest("Test case %s depends on %s but it didn't pass/run." \ + % (case.id(), dep)) @registerDecorator class OETestDepends(OETestDiscover): |