diff --git a/tests/crm/conftest.py b/tests/crm/conftest.py index a970a3f6dc0..654c65555fc 100755 --- a/tests/crm/conftest.py +++ b/tests/crm/conftest.py @@ -21,7 +21,7 @@ def pytest_runtest_teardown(item, nextitem): restore_cmd = "bash -c \"sonic-db-cli CONFIG_DB hset 'CRM|Config' {threshold_name}_threshold_type percentage \ && sonic-db-cli CONFIG_DB hset 'CRM|Config' {threshold_name}_high_threshold {high} \ && sonic-db-cli CONFIG_DB hset 'CRM|Config' {threshold_name}_low_threshold {low}\"" - if not item.rep_call.skipped: + if item.rep_setup.passed and not item.rep_call.skipped: # Restore CRM threshods if crm_threshold_name: crm_thresholds = item.funcargs["crm_thresholds"]