@@ -387,8 +387,7 @@ def test_realpath_pardir(self):
387387 self .assertEqual (realpath (b'../..' ), dirname (dirname (os .getcwdb ())))
388388 self .assertEqual (realpath (b'/' .join ([b'..' ] * 100 )), b'/' )
389389
390- @unittest .skipUnless (hasattr (os , "symlink" ),
391- "Missing symlink implementation" )
390+ @os_helper .skip_unless_symlink
392391 @skip_if_ABSTFN_contains_backslash
393392 def test_realpath_basic (self ):
394393 # Basic operation.
@@ -398,8 +397,7 @@ def test_realpath_basic(self):
398397 finally :
399398 os_helper .unlink (ABSTFN )
400399
401- @unittest .skipUnless (hasattr (os , "symlink" ),
402- "Missing symlink implementation" )
400+ @os_helper .skip_unless_symlink
403401 @skip_if_ABSTFN_contains_backslash
404402 def test_realpath_strict (self ):
405403 # Bug #43757: raise FileNotFoundError in strict mode if we encounter
@@ -411,8 +409,7 @@ def test_realpath_strict(self):
411409 finally :
412410 os_helper .unlink (ABSTFN )
413411
414- @unittest .skipUnless (hasattr (os , "symlink" ),
415- "Missing symlink implementation" )
412+ @os_helper .skip_unless_symlink
416413 @skip_if_ABSTFN_contains_backslash
417414 def test_realpath_relative (self ):
418415 try :
@@ -421,8 +418,7 @@ def test_realpath_relative(self):
421418 finally :
422419 os_helper .unlink (ABSTFN )
423420
424- @unittest .skipUnless (hasattr (os , "symlink" ),
425- "Missing symlink implementation" )
421+ @os_helper .skip_unless_symlink
426422 @skip_if_ABSTFN_contains_backslash
427423 def test_realpath_symlink_loops (self ):
428424 # Bug #930024, return the path unchanged if we get into an infinite
@@ -463,8 +459,7 @@ def test_realpath_symlink_loops(self):
463459 os_helper .unlink (ABSTFN + "c" )
464460 os_helper .unlink (ABSTFN + "a" )
465461
466- @unittest .skipUnless (hasattr (os , "symlink" ),
467- "Missing symlink implementation" )
462+ @os_helper .skip_unless_symlink
468463 @skip_if_ABSTFN_contains_backslash
469464 def test_realpath_symlink_loops_strict (self ):
470465 # Bug #43757, raise OSError if we get into an infinite symlink loop in
@@ -505,8 +500,7 @@ def test_realpath_symlink_loops_strict(self):
505500 os_helper .unlink (ABSTFN + "c" )
506501 os_helper .unlink (ABSTFN + "a" )
507502
508- @unittest .skipUnless (hasattr (os , "symlink" ),
509- "Missing symlink implementation" )
503+ @os_helper .skip_unless_symlink
510504 @skip_if_ABSTFN_contains_backslash
511505 def test_realpath_repeated_indirect_symlinks (self ):
512506 # Issue #6975.
@@ -520,8 +514,7 @@ def test_realpath_repeated_indirect_symlinks(self):
520514 os_helper .unlink (ABSTFN + '/link' )
521515 safe_rmdir (ABSTFN )
522516
523- @unittest .skipUnless (hasattr (os , "symlink" ),
524- "Missing symlink implementation" )
517+ @os_helper .skip_unless_symlink
525518 @skip_if_ABSTFN_contains_backslash
526519 def test_realpath_deep_recursion (self ):
527520 depth = 10
@@ -540,8 +533,7 @@ def test_realpath_deep_recursion(self):
540533 os_helper .unlink (ABSTFN + '/%d' % i )
541534 safe_rmdir (ABSTFN )
542535
543- @unittest .skipUnless (hasattr (os , "symlink" ),
544- "Missing symlink implementation" )
536+ @os_helper .skip_unless_symlink
545537 @skip_if_ABSTFN_contains_backslash
546538 def test_realpath_resolve_parents (self ):
547539 # We also need to resolve any symlinks in the parents of a relative
@@ -560,8 +552,7 @@ def test_realpath_resolve_parents(self):
560552 safe_rmdir (ABSTFN + "/y" )
561553 safe_rmdir (ABSTFN )
562554
563- @unittest .skipUnless (hasattr (os , "symlink" ),
564- "Missing symlink implementation" )
555+ @os_helper .skip_unless_symlink
565556 @skip_if_ABSTFN_contains_backslash
566557 def test_realpath_resolve_before_normalizing (self ):
567558 # Bug #990669: Symbolic links should be resolved before we
@@ -589,8 +580,7 @@ def test_realpath_resolve_before_normalizing(self):
589580 safe_rmdir (ABSTFN + "/k" )
590581 safe_rmdir (ABSTFN )
591582
592- @unittest .skipUnless (hasattr (os , "symlink" ),
593- "Missing symlink implementation" )
583+ @os_helper .skip_unless_symlink
594584 @skip_if_ABSTFN_contains_backslash
595585 def test_realpath_resolve_first (self ):
596586 # Bug #1213894: The first component of the path, if not absolute,
0 commit comments