@@ -103,7 +103,7 @@ def test_source_strip_multiline():
103103def test_syntaxerror_rerepresentation ():
104104 ex = py .test .raises (SyntaxError , py .code .compile , 'xyz xyz' )
105105 assert ex .value .lineno == 1
106- assert ex .value .offset in (4 , 7 ) # XXX pypy/jython versus cpython?
106+ assert ex .value .offset in (5 , 7 ) # pypy/cpython difference
107107 assert ex .value .text .strip (), 'x x'
108108
109109def test_isparseable ():
@@ -510,11 +510,17 @@ def test_comments():
510510comment 4
511511"""
512512'''
513- for line in range (2 ,6 ):
514- assert str (getstatement (line , source )) == ' x = 1'
515- for line in range (6 ,10 ):
516- assert str (getstatement (line , source )) == ' assert False'
517- assert str (getstatement (10 , source )) == '"""'
513+ for line in range (2 , 6 ):
514+ assert str (getstatement (line , source )) == " x = 1"
515+ if sys .version_info >= (3 , 8 ) or hasattr (sys , "pypy_version_info" ):
516+ tqs_start = 8
517+ else :
518+ tqs_start = 10
519+ assert str (getstatement (10 , source )) == '"""'
520+ for line in range (6 , tqs_start ):
521+ assert str (getstatement (line , source )) == " assert False"
522+ for line in range (tqs_start , 10 ):
523+ assert str (getstatement (line , source )) == '"""\n comment 4\n """'
518524
519525def test_comment_in_statement ():
520526 source = '''test(foo=1,
0 commit comments