Skip to content

Commit

Permalink
Pass 'encoding' to target.open in test_open_text_FileNotFoundError. F…
Browse files Browse the repository at this point in the history
…ixes #280.
  • Loading branch information
jaraco committed Feb 17, 2023
1 parent ff16bd3 commit 28d26e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v5.10.4
=======

* #280: Fixed one more ``EncodingWarning`` in test suite.

v5.10.3
=======

Expand Down
6 changes: 4 additions & 2 deletions importlib_resources/tests/test_open.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ def test_open_text_with_errors(self):

def test_open_binary_FileNotFoundError(self):
target = resources.files(self.data) / 'does-not-exist'
self.assertRaises(FileNotFoundError, target.open, 'rb')
with self.assertRaises(FileNotFoundError):
target.open('rb')

def test_open_text_FileNotFoundError(self):
target = resources.files(self.data) / 'does-not-exist'
self.assertRaises(FileNotFoundError, target.open)
with self.assertRaises(FileNotFoundError):
target.open(encoding='utf-8')


class OpenDiskTests(OpenTests, unittest.TestCase):
Expand Down

0 comments on commit 28d26e8

Please sign in to comment.