@@ -387,8 +387,7 @@ def test_realpath_pardir(self):
387
387
self .assertEqual (realpath (b'../..' ), dirname (dirname (os .getcwdb ())))
388
388
self .assertEqual (realpath (b'/' .join ([b'..' ] * 100 )), b'/' )
389
389
390
- @unittest .skipUnless (hasattr (os , "symlink" ),
391
- "Missing symlink implementation" )
390
+ @os_helper .skip_unless_symlink
392
391
@skip_if_ABSTFN_contains_backslash
393
392
def test_realpath_basic (self ):
394
393
# Basic operation.
@@ -398,8 +397,7 @@ def test_realpath_basic(self):
398
397
finally :
399
398
os_helper .unlink (ABSTFN )
400
399
401
- @unittest .skipUnless (hasattr (os , "symlink" ),
402
- "Missing symlink implementation" )
400
+ @os_helper .skip_unless_symlink
403
401
@skip_if_ABSTFN_contains_backslash
404
402
def test_realpath_strict (self ):
405
403
# Bug #43757: raise FileNotFoundError in strict mode if we encounter
@@ -411,8 +409,7 @@ def test_realpath_strict(self):
411
409
finally :
412
410
os_helper .unlink (ABSTFN )
413
411
414
- @unittest .skipUnless (hasattr (os , "symlink" ),
415
- "Missing symlink implementation" )
412
+ @os_helper .skip_unless_symlink
416
413
@skip_if_ABSTFN_contains_backslash
417
414
def test_realpath_relative (self ):
418
415
try :
@@ -421,8 +418,7 @@ def test_realpath_relative(self):
421
418
finally :
422
419
os_helper .unlink (ABSTFN )
423
420
424
- @unittest .skipUnless (hasattr (os , "symlink" ),
425
- "Missing symlink implementation" )
421
+ @os_helper .skip_unless_symlink
426
422
@skip_if_ABSTFN_contains_backslash
427
423
def test_realpath_symlink_loops (self ):
428
424
# Bug #930024, return the path unchanged if we get into an infinite
@@ -463,8 +459,7 @@ def test_realpath_symlink_loops(self):
463
459
os_helper .unlink (ABSTFN + "c" )
464
460
os_helper .unlink (ABSTFN + "a" )
465
461
466
- @unittest .skipUnless (hasattr (os , "symlink" ),
467
- "Missing symlink implementation" )
462
+ @os_helper .skip_unless_symlink
468
463
@skip_if_ABSTFN_contains_backslash
469
464
def test_realpath_symlink_loops_strict (self ):
470
465
# Bug #43757, raise OSError if we get into an infinite symlink loop in
@@ -505,8 +500,7 @@ def test_realpath_symlink_loops_strict(self):
505
500
os_helper .unlink (ABSTFN + "c" )
506
501
os_helper .unlink (ABSTFN + "a" )
507
502
508
- @unittest .skipUnless (hasattr (os , "symlink" ),
509
- "Missing symlink implementation" )
503
+ @os_helper .skip_unless_symlink
510
504
@skip_if_ABSTFN_contains_backslash
511
505
def test_realpath_repeated_indirect_symlinks (self ):
512
506
# Issue #6975.
@@ -520,8 +514,7 @@ def test_realpath_repeated_indirect_symlinks(self):
520
514
os_helper .unlink (ABSTFN + '/link' )
521
515
safe_rmdir (ABSTFN )
522
516
523
- @unittest .skipUnless (hasattr (os , "symlink" ),
524
- "Missing symlink implementation" )
517
+ @os_helper .skip_unless_symlink
525
518
@skip_if_ABSTFN_contains_backslash
526
519
def test_realpath_deep_recursion (self ):
527
520
depth = 10
@@ -540,8 +533,7 @@ def test_realpath_deep_recursion(self):
540
533
os_helper .unlink (ABSTFN + '/%d' % i )
541
534
safe_rmdir (ABSTFN )
542
535
543
- @unittest .skipUnless (hasattr (os , "symlink" ),
544
- "Missing symlink implementation" )
536
+ @os_helper .skip_unless_symlink
545
537
@skip_if_ABSTFN_contains_backslash
546
538
def test_realpath_resolve_parents (self ):
547
539
# We also need to resolve any symlinks in the parents of a relative
@@ -560,8 +552,7 @@ def test_realpath_resolve_parents(self):
560
552
safe_rmdir (ABSTFN + "/y" )
561
553
safe_rmdir (ABSTFN )
562
554
563
- @unittest .skipUnless (hasattr (os , "symlink" ),
564
- "Missing symlink implementation" )
555
+ @os_helper .skip_unless_symlink
565
556
@skip_if_ABSTFN_contains_backslash
566
557
def test_realpath_resolve_before_normalizing (self ):
567
558
# Bug #990669: Symbolic links should be resolved before we
@@ -589,8 +580,7 @@ def test_realpath_resolve_before_normalizing(self):
589
580
safe_rmdir (ABSTFN + "/k" )
590
581
safe_rmdir (ABSTFN )
591
582
592
- @unittest .skipUnless (hasattr (os , "symlink" ),
593
- "Missing symlink implementation" )
583
+ @os_helper .skip_unless_symlink
594
584
@skip_if_ABSTFN_contains_backslash
595
585
def test_realpath_resolve_first (self ):
596
586
# Bug #1213894: The first component of the path, if not absolute,
0 commit comments