Skip to content

Commit

Permalink
refactor(solver.py): move setting of prev_mark into `TestcaseExecut…
Browse files Browse the repository at this point in the history
…or.__init__()`
  • Loading branch information
matosys committed Oct 14, 2024
1 parent 197f559 commit 91642ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 10 additions & 2 deletions src/_balder/executor/testcase_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
import time
import traceback

from _balder.executor.basic_executor import BasicExecutor
from _balder.fixture_execution_level import FixtureExecutionLevel
from _balder.utils import inspect_method
from _balder.previous_executor_mark import PreviousExecutorMark
from _balder.testresult import ResultState, TestcaseResult
from _balder.executor.basic_executor import BasicExecutor
from _balder.utils import inspect_method

if TYPE_CHECKING:
from _balder.executor.variation_executor import VariationExecutor
Expand Down Expand Up @@ -39,6 +40,13 @@ def __init__(self, testcase: callable, parent: VariationExecutor):
# holds the raw test execution time in seconds
self.test_execution_time_sec = 0

# determine prev_mark IGNORE/SKIP for the testcase
if self.should_be_skipped():
self.prev_mark = PreviousExecutorMark.SKIP
# always overwrite if it should be ignored
if self.should_be_ignored():
self.prev_mark = PreviousExecutorMark.IGNORE

# ---------------------------------- STATIC METHODS ----------------------------------------------------------------

# ---------------------------------- CLASS METHODS ----------------------------------------------------------------
Expand Down
7 changes: 0 additions & 7 deletions src/_balder/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,6 @@ def get_executor_tree(self, plugin_manager: PluginManager, add_discarded=False)
cur_testcase_executor = TestcaseExecutor(cur_testcase, parent=variation_executor)
variation_executor.add_testcase_executor(cur_testcase_executor)

# determine prev_mark IGNORE/SKIP for the testcase
if cur_testcase_executor.should_be_skipped():
cur_testcase_executor.prev_mark = PreviousExecutorMark.SKIP
# always overwrite if it should be ignored
if cur_testcase_executor.should_be_ignored():
cur_testcase_executor.prev_mark = PreviousExecutorMark.IGNORE

# now filter all elements that have no child elements
# -> these are items that have no valid matching, because no variation can be applied for it (there are no
# required :class:`Feature` matching or there exists no possible routing for the variation)
Expand Down

0 comments on commit 91642ea

Please sign in to comment.