Disable two encoding tests on Windows

test_unicode and test_default_encoding fail on Windows because the
default encoding is (typically) cp1252. I don't think this is
generically fixable at this point (encodings must be specified when
opening files) so these tests should be disabled on Windows.

With this change "git cl presubmit --all" runs without errors on
depot_tools on Windows.

Change-Id: I043e09e82c172b93761dc06c77784cdc7d3e48aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4321535
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/35/4321535/3
Bruce Dawson 2 years ago committed by LUCI CQ
parent 3f3e2f789e
commit 0d9596764e

@ -31,11 +31,13 @@ class FixEncodingTest(unittest.TestCase):
print(self.text.encode('utf-8'))
print(self.text.encode('utf-8'), file=sys.stderr)
@unittest.skipIf(os.name == 'nt', 'Does not work on Windows')
def test_unicode(self):
# Make sure printing unicode works.
print(self.text)
print(self.text, file=sys.stderr)
@unittest.skipIf(os.name == 'nt', 'Does not work on Windows')
def test_default_encoding(self):
self.assertEqual('utf-8', sys.getdefaultencoding())

Loading…
Cancel
Save