@@ -85,17 +85,16 @@ def test_detect_arch(self, machine, expected):
8585 with mock .patch ("platform.machine" , return_value = machine ):
8686 assert _CoreLoader ._detect_arch () == expected
8787
88- def test_detect_libc_alpine (self , tmp_path ):
89- """Test _detect_libc returns musl on Alpine Linux."""
90- with mock .patch ("pathlib.Path.exists" , return_value = True ):
88+ def test_detect_libc_glibc (self ):
89+ """Test _detect_libc returns glibc when platform reports glibc."""
90+ with mock .patch ("platform.libc_ver" , return_value = ("glibc" , "2.31" )):
91+ assert _CoreLoader ._detect_libc () == "glibc"
92+
93+ def test_detect_libc_musl (self ):
94+ """Test _detect_libc returns musl when platform does not report glibc."""
95+ with mock .patch ("platform.libc_ver" , return_value = ("" , "" )):
9196 assert _CoreLoader ._detect_libc () == "musl"
9297
93- def test_detect_libc_glibc_default (self ):
94- """Test _detect_libc returns glibc by default."""
95- with mock .patch ("pathlib.Path.exists" , return_value = False ):
96- with mock .patch ("subprocess.run" , side_effect = Exception ("not found" )):
97- assert _CoreLoader ._detect_libc () == "glibc"
98-
9998 @pytest .mark .parametrize (
10099 "os_name,arch,libc,expected_subdir" ,
101100 [
0 commit comments