summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2018-01-17 14:21:50 (GMT)
committerGitHub <noreply@github.com>2018-01-17 14:21:50 (GMT)
commit3a0cf931796b9ad1b4833ab89c79d284b4253c91 (patch)
treeb8daef2efe307173a7c76f3b11945a0592582f44
parent44a70e9336765404057b12345465844dc291297a (diff)
downloadcpython-3a0cf931796b9ad1b4833ab89c79d284b4253c91.zip
cpython-3a0cf931796b9ad1b4833ab89c79d284b4253c91.tar.gz
cpython-3a0cf931796b9ad1b4833ab89c79d284b4253c91.tar.bz2
bpo-32248: Fix test_importlib.test_open() (#5213)
Use the binary.file instead of utf-8.file to avoid issues with Unix newlines vs Windows newlines.
-rw-r--r--Lib/test/test_importlib/test_open.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_importlib/test_open.py b/Lib/test/test_importlib/test_open.py
index ad236c6..fd6e84b 100644
--- a/Lib/test/test_importlib/test_open.py
+++ b/Lib/test/test_importlib/test_open.py
@@ -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: