11# SPDX-FileCopyrightText: Alliander N. V.
22#
33# SPDX-License-Identifier: Apache-2.0
4-
54import random
65import subprocess
76
1413camera = Camera (random .choice (["realsense" , "zed" ]), (0 , 0 , 0.5 ))
1514PLATFORMS = [camera ]
1615
17- system_architecture = subprocess .getoutput ("dpkg --print-architecture" )
18- if system_architecture != "amd64" :
19- pytest .skip (
20- f"Camera tests skipped, not supported on { system_architecture } yet." ,
21- allow_module_level = True ,
22- )
16+
17+ def skip_if_not_amd64 () -> None :
18+ """Skip the test if the system architecture is not amd64."""
19+ if subprocess .getoutput ("dpkg --print-architecture" ) != "amd64" :
20+ pytest .skip ("Test skipped, not supported on non-amd64 system yet." )
2321
2422
2523def test_color_image_published (timeout : int ) -> None :
@@ -28,6 +26,7 @@ def test_color_image_published(timeout: int) -> None:
2826 Args:
2927 timeout (int): The timeout in seconds.
3028 """
29+ skip_if_not_amd64 ()
3130 assert_for_message (Image , f"/{ camera .namespace } /color/image_raw" , timeout = timeout )
3231
3332
@@ -37,6 +36,7 @@ def test_color_camera_info_published(timeout: int) -> None:
3736 Args:
3837 timeout (int): The timeout in seconds.
3938 """
39+ skip_if_not_amd64 ()
4040 assert_for_message (
4141 CameraInfo , f"/{ camera .namespace } /color/camera_info" , timeout = timeout
4242 )
@@ -48,6 +48,7 @@ def test_depth_image_published(timeout: int) -> None:
4848 Args:
4949 timeout (int): The timeout in seconds.
5050 """
51+ skip_if_not_amd64 ()
5152 assert_for_message (
5253 Image , f"/{ camera .namespace } /depth/image_rect_raw" , timeout = timeout
5354 )
@@ -59,6 +60,7 @@ def test_depth_camera_info_published(timeout: int) -> None:
5960 Args:
6061 timeout (int): The timeout in seconds.
6162 """
63+ skip_if_not_amd64 ()
6264 assert_for_message (
6365 CameraInfo , f"/{ camera .namespace } /depth/camera_info" , timeout = timeout
6466 )
0 commit comments