]> granicus.if.org Git - python/commitdiff
bpo-32248: Fix test_importlib.test_open() (#5213)
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 17 Jan 2018 14:21:50 +0000 (15:21 +0100)
committerGitHub <noreply@github.com>
Wed, 17 Jan 2018 14:21:50 +0000 (15:21 +0100)
Use the binary.file instead of utf-8.file to avoid issues with
Unix newlines vs Windows newlines.

Lib/test/test_importlib/test_open.py

index ad236c617169fdd4caf79a0eb69fda0538b4aae5..fd6e84b70f65c275ebdf0915c5384e0dc0e156a2 100644 (file)
@@ -19,9 +19,9 @@ class CommonTextTests(util.CommonResourceTests, unittest.TestCase):
 
 class OpenTests:
     def test_open_binary(self):
-        with resources.open_binary(self.data, 'utf-8.file') as fp:
+        with resources.open_binary(self.data, 'binary.file') as fp:
             result = fp.read()
-            self.assertEqual(result, b'Hello, UTF-8 world!\n')
+            self.assertEqual(result, b'\x00\x01\x02\x03')
 
     def test_open_text_default_encoding(self):
         with resources.open_text(self.data, 'utf-8.file') as fp: