15
15
checkRecursive ,
16
16
iterSourceCode ,
17
17
)
18
- from pyflakes .test .harness import TestCase
18
+ from pyflakes .test .harness import TestCase , skipIf
19
19
20
20
if sys .version_info < (3 ,):
21
21
from cStringIO import StringIO
@@ -419,6 +419,7 @@ def test_invalidEscape(self):
419
419
self .assertHasErrors (
420
420
sourcePath , [decoding_error ])
421
421
422
+ @skipIf (sys .platform == 'win32' , 'unsupported on Windows' )
422
423
def test_permissionDenied (self ):
423
424
"""
424
425
If the source file is not readable, this is reported on standard
@@ -583,7 +584,7 @@ def test_fileWithFlakes(self):
583
584
fd .close ()
584
585
d = self .runPyflakes ([self .tempfilepath ])
585
586
expected = UnusedImport (self .tempfilepath , Node (1 ), 'contraband' )
586
- self .assertEqual (d , ("%s\n " % expected , '' , 1 ))
587
+ self .assertEqual (d , ("%s%s " % ( expected , os . linesep ) , '' , 1 ))
587
588
588
589
def test_errors (self ):
589
590
"""
@@ -592,7 +593,8 @@ def test_errors(self):
592
593
printed to stderr.
593
594
"""
594
595
d = self .runPyflakes ([self .tempfilepath ])
595
- error_msg = '%s: No such file or directory\n ' % (self .tempfilepath ,)
596
+ error_msg = '%s: No such file or directory%s' % (self .tempfilepath ,
597
+ os .linesep )
596
598
self .assertEqual (d , ('' , error_msg , 1 ))
597
599
598
600
def test_readFromStdin (self ):
@@ -601,4 +603,4 @@ def test_readFromStdin(self):
601
603
"""
602
604
d = self .runPyflakes ([], stdin = 'import contraband' .encode ('ascii' ))
603
605
expected = UnusedImport ('<stdin>' , Node (1 ), 'contraband' )
604
- self .assertEqual (d , ("%s\n " % expected , '' , 1 ))
606
+ self .assertEqual (d , ("%s%s " % ( expected , os . linesep ) , '' , 1 ))
0 commit comments