Auto merge of #25239 - marmeladema:issue-23607/test-tidy-no-wpt, r=jdm

Make `mach test-tidy --no-wpt` compatible with Python3

Make `mach test-tidy --no-wpt` compatible with Python3
See also #23607

After this pull request, all python files (except WPT) will be checked for Python3 syntax compatibility.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2019-12-11 15:26:09 -05:00 committed by GitHub
commit b3b72cb9e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 118 additions and 107 deletions

View file

@ -54,9 +54,9 @@ for key in keys:
value1 = data1.get(key)
value2 = data2.get(key)
if value1 and not(value2):
print ("{}Test {}: missing from {}.{}".format(WARNING, key, args.file2, END))
print("{}Test {}: missing from {}.{}".format(WARNING, key, args.file2, END))
elif value2 and not(value1):
print ("{}Test {}: missing from {}.{}".format(WARNING, key, args.file1, END))
print("{}Test {}: missing from {}.{}".format(WARNING, key, args.file1, END))
elif value1 and value2:
total1 += value1
total2 += value2

View file

@ -69,7 +69,7 @@ def transform_report_for_test(report):
while remaining:
(name, value) = remaining.pop()
transformed[name] = '%s %s' % (value['amount'], value['unit'])
remaining += map(lambda (k, v): (name + '/' + k, v), list(value['children'].items()))
remaining += map(lambda k_v: (name + '/' + k_v[0], k_v[1]), list(value['children'].items()))
return transformed

View file

@ -205,6 +205,7 @@ def linux_tidy_unit():
.with_treeherder("Linux x64", "Tidy+Unit")
.with_script("""
./mach test-tidy --no-progress --all
python3 ./mach test-tidy --no-progress --all --no-wpt
python3 ./mach build --dev
python3 ./mach test-unit
python3 ./mach package --dev