mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-106531: Apply changes from importlib_resources 6.3.2 (#117054)
Apply changes from importlib_resources 6.3.2.
This commit is contained in:
parent
31a4fb3c74
commit
8d63c8d47b
16 changed files with 231 additions and 146 deletions
|
@ -5,6 +5,7 @@ import pathlib
|
|||
from test.support import os_helper
|
||||
|
||||
from importlib import resources
|
||||
from importlib.resources import abc
|
||||
from importlib.resources.abc import TraversableResources, ResourceReader
|
||||
from . import util
|
||||
|
||||
|
@ -39,8 +40,9 @@ class CustomTraversableResourcesTests(unittest.TestCase):
|
|||
self.addCleanup(self.fixtures.close)
|
||||
|
||||
def test_custom_loader(self):
|
||||
temp_dir = self.fixtures.enter_context(os_helper.temp_dir())
|
||||
temp_dir = pathlib.Path(self.fixtures.enter_context(os_helper.temp_dir()))
|
||||
loader = SimpleLoader(MagicResources(temp_dir))
|
||||
pkg = util.create_package_from_loader(loader)
|
||||
files = resources.files(pkg)
|
||||
assert files is temp_dir
|
||||
assert isinstance(files, abc.Traversable)
|
||||
assert list(files.iterdir()) == []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue