baldertest 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
_balder/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.1.1'
32
- __version_tuple__ = version_tuple = (0, 1, 1)
31
+ __version__ = version = '0.1.2'
32
+ __version_tuple__ = version_tuple = (0, 1, 2)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -62,9 +62,10 @@ class ExecutorTree(BasicExecutableExecutor):
62
62
  self.update_inner_feature_reference_in_all_setups()
63
63
 
64
64
  def _body_execution(self, show_discarded):
65
- for cur_setup_executor in self.get_setup_executors():
65
+ for cur_setup_executor in self.get_setup_executors(return_discarded=show_discarded):
66
66
  prev_mark = cur_setup_executor.prev_mark
67
- if cur_setup_executor.has_runnable_tests(show_discarded) or cur_setup_executor.has_skipped_tests():
67
+ if cur_setup_executor.has_runnable_tests(consider_discarded_too=show_discarded) \
68
+ or cur_setup_executor.has_skipped_tests():
68
69
  cur_setup_executor.execute(show_discarded=show_discarded)
69
70
  elif prev_mark == PreviousExecutorMark.SKIP:
70
71
  cur_setup_executor.set_result_for_whole_branch(ResultState.SKIP)
@@ -78,17 +79,30 @@ class ExecutorTree(BasicExecutableExecutor):
78
79
 
79
80
  # ---------------------------------- METHODS -----------------------------------------------------------------------
80
81
 
81
- def get_setup_executors(self) -> List[SetupExecutor]:
82
- """returns all setup executors of this tree"""
83
- return self._setup_executors
82
+ def get_setup_executors(self, return_discarded=False) -> List[SetupExecutor]:
83
+ """
84
+ returns all setup executors of this tree
84
85
 
85
- def get_all_scenario_executors(self) -> List[ScenarioExecutor]:
86
+ :param return_discarded: True if the method should return discarded variations too
87
+
88
+ :return: a list of relevant :class:`SetupExecutor`
89
+ """
90
+ if return_discarded:
91
+ return self._setup_executors
92
+
93
+ return [
94
+ cur_setup_executor
95
+ for cur_setup_executor in self._setup_executors
96
+ if len(cur_setup_executor.get_scenario_executors(return_discarded=False)) > 0
97
+ ]
98
+
99
+ def get_all_scenario_executors(self, return_discarded=False) -> List[ScenarioExecutor]:
86
100
  """
87
101
  returns a list with all scenario executors
88
102
  """
89
103
  all_scenario_executor = []
90
- for cur_setup_executor in self.get_setup_executors():
91
- all_scenario_executor += cur_setup_executor.get_scenario_executors()
104
+ for cur_setup_executor in self.get_setup_executors(return_discarded=return_discarded):
105
+ all_scenario_executor += cur_setup_executor.get_scenario_executors(return_discarded=return_discarded)
92
106
  return all_scenario_executor
93
107
 
94
108
  def get_all_variation_executors(self, return_discarded=False) -> List[VariationExecutor]:
@@ -96,7 +110,7 @@ class ExecutorTree(BasicExecutableExecutor):
96
110
  returns a list with all variation executors
97
111
  """
98
112
  all_variation_executor = []
99
- for cur_scenario_executor in self.get_all_scenario_executors():
113
+ for cur_scenario_executor in self.get_all_scenario_executors(return_discarded=return_discarded):
100
114
  all_variation_executor += cur_scenario_executor.get_variation_executors(return_discarded=return_discarded)
101
115
  return all_variation_executor
102
116
 
@@ -136,9 +150,9 @@ class ExecutorTree(BasicExecutableExecutor):
136
150
 
137
151
  def cleanup_empty_executor_branches(self, consider_discarded=False):
138
152
  to_remove_executor = []
139
- for cur_setup_executor in self.get_setup_executors():
153
+ for cur_setup_executor in self.get_setup_executors(return_discarded=consider_discarded):
140
154
  cur_setup_executor.cleanup_empty_executor_branches(consider_discarded=consider_discarded)
141
- if len(cur_setup_executor.get_scenario_executors()) == 0:
155
+ if len(cur_setup_executor.get_scenario_executors(return_discarded=consider_discarded)) == 0:
142
156
  # remove this whole executor because it has no children anymore
143
157
  to_remove_executor.append(cur_setup_executor)
144
158
  for cur_setup_executor in to_remove_executor:
@@ -169,7 +183,7 @@ class ExecutorTree(BasicExecutableExecutor):
169
183
  print_line(start_text)
170
184
  # check if there exists runnable elements
171
185
  runnables = [cur_exec.has_runnable_tests(consider_discarded_too=show_discarded)
172
- for cur_exec in self.get_setup_executors()]
186
+ for cur_exec in self.get_setup_executors(return_discarded=show_discarded)]
173
187
  one_or_more_runnable_setups = None if len(runnables) == 0 else max(runnables)
174
188
  if one_or_more_runnable_setups:
175
189
  super().execute(show_discarded=show_discarded)
@@ -189,8 +203,8 @@ class ExecutorTree(BasicExecutableExecutor):
189
203
  def print_tree(self, show_discarded=False) -> None:
190
204
  """this method is an auxiliary method which outputs the entire tree"""
191
205
  print("RESOLVING OVERVIEW", end="\n\n")
192
- for cur_setup_executor in self.get_setup_executors():
193
- for cur_scenario_executor in cur_setup_executor.get_scenario_executors():
206
+ for cur_setup_executor in self.get_setup_executors(return_discarded=show_discarded):
207
+ for cur_scenario_executor in cur_setup_executor.get_scenario_executors(return_discarded=show_discarded):
194
208
  for cur_variation_executor in cur_scenario_executor.get_variation_executors(
195
209
  return_discarded=show_discarded):
196
210
  applicable = cur_variation_executor.prev_mark != PreviousExecutorMark.DISCARDED
@@ -99,7 +99,8 @@ class ScenarioExecutor(BasicExecutableExecutor):
99
99
  def _body_execution(self, show_discarded):
100
100
  for cur_variation_executor in self.get_variation_executors(return_discarded=show_discarded):
101
101
  prev_mark = cur_variation_executor.prev_mark
102
- if cur_variation_executor.has_runnable_tests() or cur_variation_executor.has_skipped_tests():
102
+ if cur_variation_executor.has_runnable_tests(consider_discarded_too=show_discarded) \
103
+ or cur_variation_executor.has_skipped_tests():
103
104
  cur_variation_executor.execute(show_discarded=show_discarded)
104
105
  elif prev_mark == PreviousExecutorMark.SKIP:
105
106
  cur_variation_executor.set_result_for_whole_branch(ResultState.SKIP)
@@ -79,9 +79,10 @@ class SetupExecutor(BasicExecutableExecutor):
79
79
  print(f"SETUP {self.base_setup_class.__class__.__name__}")
80
80
 
81
81
  def _body_execution(self, show_discarded):
82
- for cur_scenario_executor in self.get_scenario_executors():
82
+ for cur_scenario_executor in self.get_scenario_executors(return_discarded=show_discarded):
83
83
  prev_mark = cur_scenario_executor.prev_mark
84
- if cur_scenario_executor.has_runnable_tests(show_discarded) or cur_scenario_executor.has_skipped_tests():
84
+ if cur_scenario_executor.has_runnable_tests(consider_discarded_too=show_discarded) \
85
+ or cur_scenario_executor.has_skipped_tests():
85
86
  cur_scenario_executor.execute(show_discarded=show_discarded)
86
87
  elif prev_mark == PreviousExecutorMark.SKIP:
87
88
  cur_scenario_executor.set_result_for_whole_branch(ResultState.SKIP)
@@ -123,13 +124,26 @@ class SetupExecutor(BasicExecutableExecutor):
123
124
  # object
124
125
  setattr(cur_feature, cur_ref_feature_name, replacing_candidate)
125
126
 
126
- def get_scenario_executors(self) -> List[ScenarioExecutor]:
127
- """returns a list with all scenario executors that belongs to this setup executor"""
128
- return self._scenario_executors
127
+ def get_scenario_executors(self, return_discarded=False) -> List[ScenarioExecutor]:
128
+ """
129
+ returns a list with all scenario executors that belongs to this setup executor
130
+
131
+ :param return_discarded: True if the method should return discarded variations too
132
+
133
+ :return: a list of relevant :class:`ScenarioExecutor`
134
+ """
135
+ if return_discarded:
136
+ return self._scenario_executors
137
+
138
+ return [
139
+ cur_scenario_executor
140
+ for cur_scenario_executor in self._scenario_executors
141
+ if len(cur_scenario_executor.get_variation_executors(return_discarded=False)) > 0
142
+ ]
129
143
 
130
144
  def cleanup_empty_executor_branches(self, consider_discarded=False):
131
145
  to_remove_executor = []
132
- for cur_scenario_executor in self.get_scenario_executors():
146
+ for cur_scenario_executor in self.get_scenario_executors(return_discarded=consider_discarded):
133
147
  cur_scenario_executor.cleanup_empty_executor_branches(consider_discarded=consider_discarded)
134
148
  if len(cur_scenario_executor.get_variation_executors(return_discarded=consider_discarded)) == 0:
135
149
  # remove this whole executor because it has no children anymore
_balder/solver.py CHANGED
@@ -219,9 +219,6 @@ class Solver:
219
219
  variation_executor = VariationExecutor(device_mapping=cur_device_mapping, parent=scenario_executor)
220
220
  variation_executor.verify_applicability()
221
221
 
222
- if not variation_executor.can_be_applied():
223
- continue
224
-
225
222
  scenario_executor.add_variation_executor(variation_executor)
226
223
 
227
224
  for cur_testcase in scenario_executor.base_scenario_controller.get_all_test_methods():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: baldertest
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: balder: reusable scenario based test framework
5
5
  Home-page: https://docs.balder.dev
6
6
  Author: Max Stahlschmidt and others
@@ -1,5 +1,5 @@
1
1
  _balder/__init__.py,sha256=Qk4wkVInPlXLFV36Yco5K7PDawJoeeWQVakzj6g5pmA,195
2
- _balder/_version.py,sha256=m8HxkqoKGw_wAJtc4ZokpJKNLXqp4zwnNhbnfDtro7w,704
2
+ _balder/_version.py,sha256=Ok5oAXdWgR9aghaFXTafTeDW6sYO3uVe6d2Nket57R4,704
3
3
  _balder/balder_plugin.py,sha256=EQzJP1dwwVDydhMLJtAmTCXOczlDuXBJur05lalmK_k,3136
4
4
  _balder/balder_session.py,sha256=ezT86gC_VzPQZOQ4r5qQ75IEm6rXZHiIpEqZDczkRsE,16149
5
5
  _balder/balder_settings.py,sha256=U96PVep7dGSaTXrMfeZMYf6oCIcEDPEqrBlFcoX476s,582
@@ -31,7 +31,7 @@ _balder/previous_executor_mark.py,sha256=gwpGu7d-kwPzQT8CmaPfuEG6fess2Upf5Q-zX6O
31
31
  _balder/routing_path.py,sha256=icIp09sC51sBsNHZPrWzGOtLqrOT5Se_dj0Db7MwtwY,17093
32
32
  _balder/scenario.py,sha256=beHkEqb9pnhrMOt1qfgATSBWVfHahw9RsOCT-uxK6TE,954
33
33
  _balder/setup.py,sha256=sIyuqhDSCzxtkWXW48jRrLDvGWkZwgpL6NvEKrFM65E,890
34
- _balder/solver.py,sha256=NbpAdvrGWdJTY6eZmNZFr7YDubyggY0yW64rDB3JkT0,13121
34
+ _balder/solver.py,sha256=eB7pf9224AJAbeF4HlMDHMMy06mmq3C-LiyX4NBlphw,13031
35
35
  _balder/testresult.py,sha256=AE_LWCwmR9aR36IHfPARaaqossBahv-P2URCZ8cFAvM,6893
36
36
  _balder/unmapped_vdevice.py,sha256=oKr01YVTLViWtZkYz8kx8ccTx-KmwgNrHuQqqD4eLQw,513
37
37
  _balder/vdevice.py,sha256=fc2xuMnTuN1RyfWh9mqFgLdSO9yGA75eERobTXUQ9JA,215
@@ -53,10 +53,10 @@ _balder/controllers/vdevice_controller.py,sha256=rWK3oHzXbNlgXf0xbWyssDevx0qQ7Bm
53
53
  _balder/executor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  _balder/executor/basic_executable_executor.py,sha256=RWwc8c4B7qO2BxlUB8dZH9IC64qm_KWh8tGCoBB8v6o,5395
55
55
  _balder/executor/basic_executor.py,sha256=6rLSBrTGodlaRVfHV2kpXPjbAqUPEq9-2txCxz_-fXg,9327
56
- _balder/executor/executor_tree.py,sha256=CfwUDUAgCb_k_haaqX7GC23DB2LLEpkL-NnSCEdufiA,10659
56
+ _balder/executor/executor_tree.py,sha256=ZyZYRyeOjvZEW_BRds9Ujfa3TrNxa_ouAGRsLNoSVwk,11457
57
57
  _balder/executor/parametrized_testcase_executor.py,sha256=Wk4XitAVOMGU7pSn7AOyvOsuL9CorcqFJ-iRuVtat1M,2149
58
- _balder/executor/scenario_executor.py,sha256=tfQ1tKvmhAUgUkAcgJ94hI46hLcXAhIMD-d9qCmJiXg,8152
59
- _balder/executor/setup_executor.py,sha256=QWMWhfzsssRT_fHOUKjw4gHfC2CaZjhL5NxF1eNl35w,8604
58
+ _balder/executor/scenario_executor.py,sha256=NMx4hJpY5Xtsd4ugrQTdX4bcczgi_aabtlqHIkMfXl8,8211
59
+ _balder/executor/setup_executor.py,sha256=-nLTH0enq7IbWMlXPZF_sY5Mt78aDesMkFpco6qU8uM,9167
60
60
  _balder/executor/testcase_executor.py,sha256=Yrifk_8hsm1KKrE6udd84EyBywmWiUN00MlcezMQ7xA,8216
61
61
  _balder/executor/unresolved_parametrized_testcase_executor.py,sha256=Pb-LhEFNspb03pYTqTyFvSWPFMoRCjO8OVjjP2rHFMw,7628
62
62
  _balder/executor/variation_executor.py,sha256=wdWOIuXqkxsl-wifuEFWYaH_hLuvaYjvotdVPMM2g8I,53252
@@ -81,9 +81,9 @@ balder/connections.py,sha256=H6rf7UsiVY_FeZLngZXCT9WDw9cQqpiDiPbz_0J4yjM,2331
81
81
  balder/devices.py,sha256=zupHtz8yaiEjzR8CrvgZU-RzsDQcZFeN5mObfhtjwSw,173
82
82
  balder/exceptions.py,sha256=iaR4P2L7K3LggYSDnjCGLheZEaGgnMilxDQdoYD5KHQ,1954
83
83
  balder/parametrization.py,sha256=R8U67f6DEnXdDc9cGOgS8yFTEAfhglv1v9mnAUAExUg,150
84
- baldertest-0.1.1.dist-info/licenses/LICENSE,sha256=kNB2-kpqR9c3rEyXsMaQiqb1jiLZ5j6R6TSda63dcJY,1089
85
- baldertest-0.1.1.dist-info/METADATA,sha256=57HxDe28UklJXBXhRu5K4JX1cVmv_UnZ7tQ7M_BiX9I,14730
86
- baldertest-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
87
- baldertest-0.1.1.dist-info/entry_points.txt,sha256=hzqu_nrMKTCi5IJqzS1fhIXWEiL7mTGZ-kgj2lUYlRU,65
88
- baldertest-0.1.1.dist-info/top_level.txt,sha256=RUkIBkNLqHMemx2C9aEpoS65dpqb6_jU-oagIPxGQEA,15
89
- baldertest-0.1.1.dist-info/RECORD,,
84
+ baldertest-0.1.2.dist-info/licenses/LICENSE,sha256=kNB2-kpqR9c3rEyXsMaQiqb1jiLZ5j6R6TSda63dcJY,1089
85
+ baldertest-0.1.2.dist-info/METADATA,sha256=OI7I2-tt0pTFpfxF95nOODxncv8y0XAXv61JWuJV0Eo,14730
86
+ baldertest-0.1.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
87
+ baldertest-0.1.2.dist-info/entry_points.txt,sha256=hzqu_nrMKTCi5IJqzS1fhIXWEiL7mTGZ-kgj2lUYlRU,65
88
+ baldertest-0.1.2.dist-info/top_level.txt,sha256=RUkIBkNLqHMemx2C9aEpoS65dpqb6_jU-oagIPxGQEA,15
89
+ baldertest-0.1.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5