Skip to content

Commit 29299e8

Browse files
authored
Merge pull request #22653 from benlangmuir/compare-faster
Speed up roundtrip syntax tests
2 parents 0e91b49 + 6215409 commit 29299e8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

utils/round-trip-syntax-test

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ class RoundTripTask(object):
7676

7777
contents = ''.join(map(lambda l: l.decode('utf-8', errors='replace'),
7878
open(self.input_filename).readlines()))
79-
lines = difflib.unified_diff(contents,
80-
self.stdout.decode('utf-8',
81-
errors='replace'),
79+
stdout_contents = self.stdout.decode('utf-8', errors='replace')
80+
81+
if contents == stdout_contents:
82+
return None
83+
84+
lines = difflib.unified_diff(contents, stdout_contents,
8285
fromfile=self.input_filename,
8386
tofile='-')
8487
diff = '\n'.join(line for line in lines)

0 commit comments

Comments
 (0)