@@ -515,7 +515,7 @@ def foo(bar=baz, bax):
515
515
"""
516
516
with self .makeTempFile (source ) as sourcePath :
517
517
if ERROR_HAS_LAST_LINE :
518
- if PYPY and sys . version_info >= ( 3 ,) :
518
+ if PYPY :
519
519
column = 7
520
520
elif sys .version_info >= (3 , 8 ):
521
521
column = 9
@@ -543,7 +543,7 @@ def test_nonKeywordAfterKeywordSyntaxError(self):
543
543
"""
544
544
with self .makeTempFile (source ) as sourcePath :
545
545
if ERROR_HAS_LAST_LINE :
546
- if PYPY and sys . version_info >= ( 3 ,) :
546
+ if PYPY :
547
547
column = 12
548
548
elif sys .version_info >= (3 , 8 ):
549
549
column = 14
@@ -578,7 +578,7 @@ def test_invalidEscape(self):
578
578
else :
579
579
position_end = 1
580
580
if PYPY :
581
- column = 6
581
+ column = 5
582
582
else :
583
583
column = 7
584
584
# Column has been "fixed" since 3.2.4 and 3.3.1
@@ -717,13 +717,6 @@ class IntegrationTests(TestCase):
717
717
"""
718
718
Tests of the pyflakes script that actually spawn the script.
719
719
"""
720
-
721
- # https://bitbucket.org/pypy/pypy/issues/3069/pypy36-on-windows-incorrect-line-separator
722
- if PYPY and sys .version_info >= (3 ,) and WIN :
723
- LINESEP = '\n '
724
- else :
725
- LINESEP = os .linesep
726
-
727
720
def setUp (self ):
728
721
self .tempdir = tempfile .mkdtemp ()
729
722
self .tempfilepath = os .path .join (self .tempdir , 'temp' )
@@ -784,7 +777,7 @@ def test_fileWithFlakes(self):
784
777
fd .write ("import contraband\n " .encode ('ascii' ))
785
778
d = self .runPyflakes ([self .tempfilepath ])
786
779
expected = UnusedImport (self .tempfilepath , Node (1 ), 'contraband' )
787
- self .assertEqual (d , ("%s%s" % (expected , self . LINESEP ), '' , 1 ))
780
+ self .assertEqual (d , ("%s%s" % (expected , os . linesep ), '' , 1 ))
788
781
789
782
def test_errors_io (self ):
790
783
"""
@@ -794,7 +787,7 @@ def test_errors_io(self):
794
787
"""
795
788
d = self .runPyflakes ([self .tempfilepath ])
796
789
error_msg = '%s: No such file or directory%s' % (self .tempfilepath ,
797
- self . LINESEP )
790
+ os . linesep )
798
791
self .assertEqual (d , ('' , error_msg , 1 ))
799
792
800
793
def test_errors_syntax (self ):
@@ -807,7 +800,7 @@ def test_errors_syntax(self):
807
800
fd .write ("import" .encode ('ascii' ))
808
801
d = self .runPyflakes ([self .tempfilepath ])
809
802
error_msg = '{0}:1:{2}: invalid syntax{1}import{1} {3}^{1}' .format (
810
- self .tempfilepath , self . LINESEP , 6 if PYPY else 7 , '' if PYPY else ' ' )
803
+ self .tempfilepath , os . linesep , 6 if PYPY else 7 , '' if PYPY else ' ' )
811
804
self .assertEqual (d , ('' , error_msg , 1 ))
812
805
813
806
def test_readFromStdin (self ):
@@ -816,15 +809,13 @@ def test_readFromStdin(self):
816
809
"""
817
810
d = self .runPyflakes ([], stdin = 'import contraband' )
818
811
expected = UnusedImport ('<stdin>' , Node (1 ), 'contraband' )
819
- self .assertEqual (d , ("%s%s" % (expected , self . LINESEP ), '' , 1 ))
812
+ self .assertEqual (d , ("%s%s" % (expected , os . linesep ), '' , 1 ))
820
813
821
814
822
815
class TestMain (IntegrationTests ):
823
816
"""
824
817
Tests of the pyflakes main function.
825
818
"""
826
- LINESEP = os .linesep
827
-
828
819
def runPyflakes (self , paths , stdin = None ):
829
820
try :
830
821
with SysStreamCapturing (stdin ) as capture :
0 commit comments