24
24
import pytest
25
25
26
26
# this package
27
+ from domdf_python_tools .compat import PYPY
27
28
from domdf_python_tools .paths import PathPlus , PosixPathPlus , WindowsPathPlus
28
29
29
30
try :
@@ -86,13 +87,14 @@ def dirlink(src, dest):
86
87
f .write (b"this is file D\n " )
87
88
os .chmod (join ("dirE" ), 0 )
88
89
89
- # Relative symlinks.
90
- os .symlink ("fileA" , join ("linkA" ))
91
- os .symlink ("non-existing" , join ("brokenLink" ))
92
- dirlink ("dirB" , join ("linkB" ))
93
- dirlink (os .path .join (".." , "dirB" ), join ("dirA" , "linkC" ))
94
- # This one goes upwards, creating a loop.
95
- dirlink (os .path .join (".." , "dirB" ), join ("dirB" , "linkD" ))
90
+ if not PYPY and sys .platform != "win32" :
91
+ # Relative symlinks.
92
+ os .symlink ("fileA" , join ("linkA" ))
93
+ os .symlink ("non-existing" , join ("brokenLink" ))
94
+ dirlink ("dirB" , join ("linkB" ))
95
+ dirlink (os .path .join (".." , "dirB" ), join ("dirA" , "linkC" ))
96
+ # This one goes upwards, creating a loop.
97
+ dirlink (os .path .join (".." , "dirB" ), join ("dirB" , "linkD" ))
96
98
97
99
yield tmp_pathplus
98
100
@@ -485,9 +487,10 @@ def test_is_dir(BASE):
485
487
assert not ((P / "non-existing" ).is_dir ())
486
488
assert not ((P / "fileA" / "bah" ).is_dir ())
487
489
488
- assert not ((P / "linkA" ).is_dir ())
489
- assert ((P / "linkB" ).is_dir ())
490
- assert not (P / "brokenLink" ).is_dir ()
490
+ if not PYPY and sys .platform != "win32" :
491
+ assert not ((P / "linkA" ).is_dir ())
492
+ assert ((P / "linkB" ).is_dir ())
493
+ assert not (P / "brokenLink" ).is_dir ()
491
494
492
495
493
496
def test_is_file (BASE ):
@@ -497,9 +500,10 @@ def test_is_file(BASE):
497
500
assert not ((P / "non-existing" ).is_file ())
498
501
assert not ((P / "fileA" / "bah" ).is_file ())
499
502
500
- assert ((P / "linkA" ).is_file ())
501
- assert not ((P / "linkB" ).is_file ())
502
- assert not ((P / "brokenLink" ).is_file ())
503
+ if not PYPY and sys .platform != "win32" :
504
+ assert ((P / "linkA" ).is_file ())
505
+ assert not ((P / "linkB" ).is_file ())
506
+ assert not ((P / "brokenLink" ).is_file ())
503
507
504
508
505
509
@only_posix
@@ -522,9 +526,10 @@ def test_is_symlink(BASE):
522
526
assert not ((P / "non-existing" ).is_symlink ())
523
527
assert not ((P / "fileA" / "bah" ).is_symlink ())
524
528
525
- assert ((P / "linkA" ).is_symlink ())
526
- assert ((P / "linkB" ).is_symlink ())
527
- assert ((P / "brokenLink" ).is_symlink ())
529
+ if not PYPY and sys .platform != "win32" :
530
+ assert ((P / "linkA" ).is_symlink ())
531
+ assert ((P / "linkB" ).is_symlink ())
532
+ assert ((P / "brokenLink" ).is_symlink ())
528
533
529
534
530
535
def test_is_fifo_false (BASE ):
0 commit comments