mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Make fix_encoding_test py3 compatible
And run it in presubmit checks R=gavinmak@google.com Change-Id: If2a8848f6ce85c466f45d9bf0f4fca6b4d75312f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3296677 Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This commit is contained in:
@@ -109,7 +109,6 @@ def CheckUnitTestsOnCommit(input_api, output_api):
|
|||||||
r'.*recipes_test\.py$',
|
r'.*recipes_test\.py$',
|
||||||
])
|
])
|
||||||
py2_only_tests = [
|
py2_only_tests = [
|
||||||
'fix_encoding_test.py',
|
|
||||||
'recipes_test.py',
|
'recipes_test.py',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
# coding=utf-8
|
# coding=utf-8
|
||||||
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||||
# Use of this source code is governed by a BSD-style license that can be
|
# Use of this source code is governed by a BSD-style license that can be
|
||||||
@@ -23,8 +23,8 @@ class FixEncodingTest(unittest.TestCase):
|
|||||||
|
|
||||||
def test_code_page(self):
|
def test_code_page(self):
|
||||||
# Make sure printing garbage won't throw.
|
# Make sure printing garbage won't throw.
|
||||||
print(self.text.encode() + '\xff')
|
print(self.text.encode() + b'\xff')
|
||||||
print(self.text.encode() + '\xff', file=sys.stderr)
|
print(self.text.encode() + b'\xff', file=sys.stderr)
|
||||||
|
|
||||||
def test_utf8(self):
|
def test_utf8(self):
|
||||||
# Make sure printing utf-8 works.
|
# Make sure printing utf-8 works.
|
||||||
@@ -58,5 +58,5 @@ class FixEncodingTest(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
assert fix_encoding.fix_encoding()
|
fix_encoding.fix_encoding()
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user