@@ -17,6 +17,7 @@ def mock_available_devices() -> list[str]:
1717 return ["mlx5_0" , "mlx5_1" , "mlx4_0" , "mlx4_1" ]
1818
1919
20+ @pytest .mark .cpu
2021def test_detect_ibv_list ():
2122 """Test detection of _ibv_get_device_list function"""
2223 # Skip this test if no real infiniband devices exist
@@ -29,6 +30,7 @@ def test_detect_ibv_list():
2930 assert isinstance (devices , list )
3031
3132
33+ @pytest .mark .cpu
3234def test_parse_max_hcas_limit ():
3335 """Test maximum HCA quantity limit"""
3436 # Create mock data with more than 32 devices
@@ -38,6 +40,7 @@ def test_parse_max_hcas_limit():
3840 assert result == many_devices [:32 ]
3941
4042
43+ @pytest .mark .cpu
4144def test_get_rdma_devices_no_env_vars (mock_available_devices : list [str ]):
4245 """Test _get_rdma_devices with no environment variables"""
4346 with (
@@ -48,6 +51,7 @@ def test_get_rdma_devices_no_env_vars(mock_available_devices: list[str]):
4851 assert sorted (devices ) == sorted (mock_available_devices )
4952
5053
54+ @pytest .mark .cpu
5155@pytest .mark .parametrize (
5256 "input_value,expected" ,
5357 [
@@ -70,6 +74,7 @@ def test_parse_basic_cases(
7074 assert result == expected
7175
7276
77+ @pytest .mark .cpu
7378@pytest .mark .parametrize (
7479 "input_value,expected" ,
7580 [
@@ -100,6 +105,7 @@ def test_parse_various_patterns(
100105 assert result == expected
101106
102107
108+ @pytest .mark .cpu
103109@pytest .mark .parametrize (
104110 "input_value,expected_result,expected_warning" ,
105111 [
@@ -127,6 +133,7 @@ def test_parse_exact_match_with_nonexistent_device(
127133 mock_logger .warning .assert_called_once_with (expected_warning )
128134
129135
136+ @pytest .mark .cpu
130137@pytest .mark .parametrize (
131138 "env_var_name,env_var_value,expected_devices" ,
132139 [
@@ -154,6 +161,7 @@ def test_get_rdma_devices_with_env_vars(
154161 assert sorted (devices ) == sorted (expected_devices )
155162
156163
164+ @pytest .mark .cpu
157165@pytest .mark .parametrize (
158166 "local_rank,gpu_count,expected_device" ,
159167 [
@@ -171,6 +179,7 @@ def test_get_my_rdma_device_basic(local_rank: int, gpu_count: int, expected_devi
171179 assert device == expected_device
172180
173181
182+ @pytest .mark .cpu
174183@pytest .mark .parametrize (
175184 "local_rank,gpu_count,devices,error" ,
176185 [
0 commit comments