mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
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.
This commit is contained in:
parent
44a70e9336
commit
3a0cf93179
1 changed files with 2 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue