@@ -52,7 +52,7 @@ def _located_static_lib_asserts(located_static_lib):
5252 assert isinstance (located_static_lib .filename , str )
5353 assert isinstance (located_static_lib .found_via , str )
5454 assert located_static_lib .found_via in ("site-packages" , "conda" , "CUDA_PATH" )
55- assert os . path . isfile (located_static_lib .abs_path )
55+ assert Path (located_static_lib .abs_path ). is_file ( )
5656
5757
5858@pytest .mark .usefixtures ("clear_find_static_lib_cache" )
@@ -69,10 +69,10 @@ def test_locate_static_lib(info_summary_append, libname):
6969
7070 info_summary_append (f"abs_path={ quote_for_shell (lib_path )} " )
7171 _located_static_lib_asserts (located_lib )
72- assert os . path . isfile (lib_path )
72+ assert Path (lib_path ). is_file ( )
7373 assert lib_path == located_lib .abs_path
7474 expected_filename = located_lib .filename
75- assert os . path . basename (lib_path ) == expected_filename
75+ assert Path (lib_path ). name == expected_filename
7676
7777
7878@pytest .mark .usefixtures ("clear_find_static_lib_cache" )
@@ -81,7 +81,7 @@ def test_locate_static_lib_search_order(monkeypatch, tmp_path):
8181 conda_rel_path = CUDADEVRT_INFO ["conda_rel_paths" ][0 ]
8282
8383 site_pkg_rel = CUDADEVRT_INFO ["site_packages_dirs" ][0 ]
84- site_packages_lib_dir = tmp_path / "site-packages" / Path (site_pkg_rel . replace ( "/" , os . sep ) )
84+ site_packages_lib_dir = tmp_path / "site-packages" / Path (site_pkg_rel )
8585 site_packages_path = _make_static_lib_file (site_packages_lib_dir , filename )
8686
8787 conda_prefix = tmp_path / "conda-prefix"
@@ -202,7 +202,7 @@ def test_find_static_lib_not_found_error_includes_cuda_home_directory_listing(mo
202202 find_static_lib ("cudadevrt" )
203203
204204 message = str (exc_info .value )
205- expected_missing_file = os . path . join ( str ( lib_dir ), filename )
205+ expected_missing_file = lib_dir / filename
206206 assert f"No such file: { expected_missing_file } " in message
207207 assert f'listdir("{ lib_dir } "):' in message
208208 assert "README.txt" in message
0 commit comments