Skip to content

Commit

Permalink
Make the assertion explicit.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Dec 21, 2023
1 parent 3766539 commit 63eb1ca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions importlib_resources/tests/test_path.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import io
import pathlib
import unittest

import importlib_resources as resources
Expand All @@ -15,13 +16,11 @@ def execute(self, package, path):
class PathTests:
def test_reading(self):
"""
Path should be readable.
Test also implicitly verifies the returned object is a pathlib.Path
instance.
Path should be readable and a pathlib.Path instance.
"""
target = resources.files(self.data) / 'utf-8.file'
with resources.as_file(target) as path:
self.assertIsInstance(path, pathlib.Path)
self.assertTrue(path.name.endswith("utf-8.file"), repr(path))
self.assertEqual('Hello, UTF-8 world!\n', path.read_text(encoding='utf-8'))

Expand Down

0 comments on commit 63eb1ca

Please sign in to comment.