mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
bpo-40924: Ensure importlib.resources.path returns an extant path (GH-20857)
This commit is contained in:
parent
e67f7db3c3
commit
2fb5f038f2
3 changed files with 24 additions and 1 deletions
|
@ -27,6 +27,15 @@ class PathTests:
|
|||
class PathDiskTests(PathTests, unittest.TestCase):
|
||||
data = data01
|
||||
|
||||
def test_natural_path(self):
|
||||
"""
|
||||
Guarantee the internal implementation detail that
|
||||
file-system-backed resources do not get the tempdir
|
||||
treatment.
|
||||
"""
|
||||
with resources.path(self.data, 'utf-8.file') as path:
|
||||
assert 'data' in str(path)
|
||||
|
||||
|
||||
class PathZipTests(PathTests, util.ZipSetup, unittest.TestCase):
|
||||
def test_remove_in_context_manager(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue