Skip to content

Commit 4624ece

Browse files
Fix missing Python scripts in TH listings (project-chip#73412)
* fix scripts * address pr comment
1 parent 9e1465a commit 4624ece

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/python_testing/TC_CNET_4_11.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
from zeroconf import ServiceBrowser, ServiceListener, Zeroconf
3030

3131
import matter.clusters as Clusters
32-
from matter.testing.matter_testing import MatterBaseTest, TestStep, default_matter_test_main, has_feature, run_if_endpoint_matches
32+
from matter.testing.decorators import has_feature, run_if_endpoint_matches
33+
from matter.testing.matter_testing import MatterBaseTest, TestStep
34+
from matter.testing.runner import default_matter_test_main
3335

3436
logger = logging.getLogger(__name__)
3537
logging.basicConfig(level=logging.INFO)

src/python_testing/TC_DA_1_7.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ class TC_DA_1_7(MatterBaseTest):
135135
--discriminator 12 34 --passcode 20202021 20202021 --bool-arg allow_sdk_dac:true"
136136
'''
137137

138+
# Class-level defaults so steps_TC_DA_1_7 (which calls expected_number_of_DUTs)
139+
# works on a bare instance at test-listing time, before setup_class runs.
140+
allow_sdk_dac = False
141+
post_cert_test = False
142+
138143
def setup_class(self):
139144
super().setup_class()
140145
self.allow_sdk_dac = self.user_params.get("allow_sdk_dac", False)

src/python_testing/TC_OPCREDS_3_8.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
# pre-existing-fabric: true
5252
# === END CI TEST ARGUMENTS ===
5353

54+
import asyncio
5455
import enum
5556
import hashlib
5657
import inspect
@@ -364,7 +365,11 @@ def steps_TC_OPCREDS_3_8(self) -> list[TestStep]:
364365
self.current_step_id = 0
365366
self.is_aggregating_steps = True
366367
self.aggregated_steps = []
367-
self.test_TC_OPCREDS_3_8()
368+
# Run the bare test body, not the run_if_endpoint_matches wrapper: the
369+
# wrapper needs a live DUT and self.event_loop, neither of which exists
370+
# at test-listing time. In aggregation mode every test_step block skips
371+
# its body, so the bare coroutine completes without device interaction.
372+
asyncio.run(inspect.unwrap(type(self).test_TC_OPCREDS_3_8)(self))
368373
finally:
369374
self.is_aggregating_steps = False
370375

src/python_testing/TC_TSTAT_2_2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def desc_TC_TSTAT_2_2(self) -> str:
5858

5959
def pics_TC_TSTAT_2_2(self):
6060
"""This function returns a list of PICS for this test case that must be True for the test to be run"""
61-
return [self.check_pics("TSTAT.S")]
61+
return ["TSTAT.S"]
6262

6363
def steps_TC_TSTAT_2_2(self) -> list[TestStep]:
6464
return [

0 commit comments

Comments
 (0)