Browse Source

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>
Bruce Dawson 2 years ago
parent
commit
0d9596764e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      tests/fix_encoding_test.py

+ 2 - 0
tests/fix_encoding_test.py

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