@@ -534,23 +534,23 @@ def test_model_checkpoint_link_checkpoint(tmp_path):
534534    ModelCheckpoint ._link_checkpoint (trainer , filepath = str (file ), linkpath = str (link ))
535535    assert  os .path .islink (link )
536536    assert  os .path .realpath (link ) ==  str (file )
537-     assert  not  link . readlink (). is_absolute ( )
537+     assert  not  os . path . isabs ( os . readlink ( link ) )
538538
539539    # link exists (is a file) 
540540    new_file1  =  tmp_path  /  "new_file1" 
541541    new_file1 .touch ()
542542    ModelCheckpoint ._link_checkpoint (trainer , filepath = str (new_file1 ), linkpath = str (link ))
543543    assert  os .path .islink (link )
544544    assert  os .path .realpath (link ) ==  str (new_file1 )
545-     assert  not  link . readlink (). is_absolute ( )
545+     assert  not  os . path . isabs ( os . readlink ( link ) )
546546
547547    # link exists (is a link) 
548548    new_file2  =  tmp_path  /  "new_file2" 
549549    new_file2 .touch ()
550550    ModelCheckpoint ._link_checkpoint (trainer , filepath = str (new_file2 ), linkpath = str (link ))
551551    assert  os .path .islink (link )
552552    assert  os .path .realpath (link ) ==  str (new_file2 )
553-     assert  not  link . readlink (). is_absolute ( )
553+     assert  not  os . path . isabs ( os . readlink ( link ) )
554554
555555    # link exists (is a folder) 
556556    folder  =  tmp_path  /  "folder" 
@@ -560,15 +560,15 @@ def test_model_checkpoint_link_checkpoint(tmp_path):
560560    ModelCheckpoint ._link_checkpoint (trainer , filepath = str (folder ), linkpath = str (folder_link ))
561561    assert  os .path .islink (folder_link )
562562    assert  os .path .realpath (folder_link ) ==  str (folder )
563-     assert  not  folder_link . readlink (). is_absolute ( )
563+     assert  not  os . path . isabs ( os . readlink ( folder_link ) )
564564
565565    # link exists (is a link to a folder) 
566566    new_folder  =  tmp_path  /  "new_folder" 
567567    new_folder .mkdir ()
568568    ModelCheckpoint ._link_checkpoint (trainer , filepath = str (new_folder ), linkpath = str (folder_link ))
569569    assert  os .path .islink (folder_link )
570570    assert  os .path .realpath (folder_link ) ==  str (new_folder )
571-     assert  not  folder_link . readlink (). is_absolute ( )
571+     assert  not  os . path . isabs ( os . readlink ( folder_link ) )
572572
573573    # simulate permission error on Windows (creation of symbolic links requires privileges) 
574574    file  =  tmp_path  /  "win_file" 
@@ -592,8 +592,8 @@ def test_model_checkpoint_link_checkpoint_relative_path(tmp_path, monkeypatch):
592592    link  =  folder  /  "link" 
593593    ModelCheckpoint ._link_checkpoint (trainer , filepath = str (file .absolute ()), linkpath = str (link .absolute ()))
594594    assert  os .path .islink (link )
595-     assert  link .readlink () ==  file .relative_to (folder )
596-     assert  not  link . readlink (). is_absolute ( )
595+     assert  Path ( os .readlink (link ) ) ==  file .relative_to (folder )
596+     assert  not  os . path . isabs ( os . readlink ( link ) )
597597
598598
599599def  test_invalid_top_k (tmpdir ):
0 commit comments