Skip to content

Commit 0a4344e

Browse files
fix runsource test for pypy
Pypy has slightly different syntax error message for an encoding comment being present in a unicode string
1 parent a2a934c commit 0a4344e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

bpython/test/test_interpreter.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,10 @@ def interp_errlog(self):
2828

2929
def err_lineno(self, a):
3030
strings = [x.__unicode__() for x in a]
31-
print('looking for lineno')
3231
for line in reversed(strings):
3332
clean_line = remove_ansi(line)
34-
print(clean_line)
3533
m = re.search(r'line (\d+)[,]', clean_line)
3634
if m:
37-
print('found!', m.group(1))
3835
return int(m.group(1))
3936
return None
4037

@@ -150,8 +147,9 @@ def test_runsource_unicode_autoencode_and_noencode(self):
150147
i, a = self.interp_errlog()
151148
i.runsource(u'#encoding: utf-8\nabc',
152149
filename='x.py', encode=encode)
153-
self.assertIn('SyntaxError: encoding',
154-
''.join(''.join(remove_ansi(x.__unicode__()) for x in a)))
150+
self.assertIn('SyntaxError:',
151+
''.join(''.join(remove_ansi(x.__unicode__())
152+
for x in a)))
155153

156154
@unittest.skipIf(py3, "encode only does anything in Python 2")
157155
def test_runsource_unicode_encode(self):

0 commit comments

Comments
 (0)