Skip to content

Commit

Permalink
fix: make force naming of reset parameter, change pop(reset) to get(r…
Browse files Browse the repository at this point in the history
…eset)
  • Loading branch information
igor udot (horw) committed Nov 14, 2023
1 parent 966fb9a commit 7d0ee35
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pytest-embedded-idf/pytest_embedded_idf/unity_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def wrapper(self, *args, **kwargs):
try:
# do it here since the first hard reset before test case shouldn't be counted in duration time
if 'reset' in kwargs:
if kwargs.pop('reset') and self._hard_reset_func:
if kwargs.get('reset') and self._hard_reset_func:
try:
self._hard_reset_func()
except NotImplementedError:
Expand All @@ -271,7 +271,6 @@ def wrapper(self, *args, **kwargs):
_timeout = 0
self.expect(UNITY_SUMMARY_LINE_REGEX, timeout=_timeout)
except Exception: # result block missing # noqa
self._hard_reset_func()
pass
else: # result block exists
_log = remove_asci_color_code(self.pexpect_proc.before)
Expand Down Expand Up @@ -327,6 +326,7 @@ def _add_single_unity_test_case(
def _run_normal_case(
self,
case: UnittestMenuCase,
*,
reset: bool = False, # noqa
timeout: float = 30,
) -> None:
Expand All @@ -352,6 +352,7 @@ def _run_normal_case(
def _run_multi_stage_case(
self,
case: UnittestMenuCase,
*,
reset: bool = False, # noqa
timeout: float = 30,
) -> None:
Expand Down Expand Up @@ -792,7 +793,7 @@ def run_normal_case(self, case: UnittestMenuCase, reset: bool = False, timeout:
reset: whether do a hardware reset before running the case
timeout: timeout in second
"""
self.first_dut._run_normal_case(case, reset, timeout=timeout)
self.first_dut._run_normal_case(case, reset=reset, timeout=timeout)

def run_multi_stage_case(self, case: UnittestMenuCase, reset: bool = False, timeout: int = 90) -> None:
"""
Expand Down

0 comments on commit 7d0ee35

Please sign in to comment.