Skip to content

Commit ef58c14

Browse files
Fixing try-except imports for test_testing directory scripts
1 parent 3147c6c commit ef58c14

File tree

3 files changed

+4
-24
lines changed

3 files changed

+4
-24
lines changed

src/python_testing/test_testing/TestDecorators.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,9 @@
3030

3131
import chip.clusters as Clusters
3232
from chip.clusters import Attribute
33-
34-
try:
35-
from matter_testing_support.matter_testing import (MatterBaseTest, async_test_body, get_accepted_endpoints_for_test,
36-
has_attribute, has_cluster, has_feature, per_endpoint_test, per_node_test)
37-
except ImportError:
38-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
39-
from matter_testing_support.matter_testing import (MatterBaseTest, async_test_body, get_accepted_endpoints_for_test, has_attribute,
40-
has_cluster, has_feature, per_endpoint_test, per_node_test)
41-
33+
from matter_testing_support.matter_testing import (MatterBaseTest, async_test_body, get_accepted_endpoints_for_test,
34+
has_attribute, has_cluster, has_feature, per_endpoint_test, per_node_test)
4235
from typing import Optional
43-
4436
from mobly import asserts
4537
from MockTestRunner import MockTestRunner
4638

src/python_testing/test_testing/test_IDM_10_4.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,7 @@
2121

2222
import chip.clusters as Clusters
2323
from chip.clusters import Attribute
24-
25-
try:
26-
from matter_testing_support.pics import parse_pics_xml
27-
except ImportError:
28-
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
29-
from matter_testing_support.pics import parse_pics_xml
30-
24+
from matter_testing_support.pics import parse_pics_xml
3125
from MockTestRunner import MockTestRunner
3226

3327
# Reachable attribute is off in the pics file

src/python_testing/test_testing/test_TC_SC_7_1.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,9 @@
2222

2323
import chip.clusters as Clusters
2424
from chip.clusters import Attribute
25+
from matter_testing_support.matter_testing import MatterTestConfig
2526
from MockTestRunner import MockTestRunner
2627

27-
try:
28-
from matter_testing_support.matter_testing import MatterTestConfig
29-
except ImportError:
30-
sys.path.append(os.path.abspath(
31-
os.path.join(os.path.dirname(__file__), '..')))
32-
from matter_testing_support.matter_testing import MatterTestConfig
33-
3428

3529
def read_trusted_root(filled: bool) -> Attribute.AsyncReadTransaction.ReadResponse:
3630
opcreds = Clusters.OperationalCredentials

0 commit comments

Comments
 (0)