From 7d0ee35d0df353015d4393d568e0963f2ca0a3cf Mon Sep 17 00:00:00 2001 From: "igor udot (horw)" Date: Tue, 19 Sep 2023 09:26:21 +0800 Subject: [PATCH] fix: make force naming of reset parameter, change pop(reset) to get(reset) --- pytest-embedded-idf/pytest_embedded_idf/unity_tester.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pytest-embedded-idf/pytest_embedded_idf/unity_tester.py b/pytest-embedded-idf/pytest_embedded_idf/unity_tester.py index 85d013db..b71e2d1d 100644 --- a/pytest-embedded-idf/pytest_embedded_idf/unity_tester.py +++ b/pytest-embedded-idf/pytest_embedded_idf/unity_tester.py @@ -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: @@ -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) @@ -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: @@ -352,6 +352,7 @@ def _run_normal_case( def _run_multi_stage_case( self, case: UnittestMenuCase, + *, reset: bool = False, # noqa timeout: float = 30, ) -> None: @@ -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: """