summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-06-29 20:59:22 (GMT)
committerGitHub <noreply@github.com>2020-06-29 20:59:22 (GMT)
commit2fb5f038f2a2e91a7293d62dfd5601e6eb500c55 (patch)
tree599ffdee6b55ed75c994e7072e21b1893b7dde79 /Lib/test
parente67f7db3c34f70536f36c56bb82e33c3512a53a3 (diff)
downloadcpython-2fb5f038f2a2e91a7293d62dfd5601e6eb500c55.zip
cpython-2fb5f038f2a2e91a7293d62dfd5601e6eb500c55.tar.gz
cpython-2fb5f038f2a2e91a7293d62dfd5601e6eb500c55.tar.bz2
bpo-40924: Ensure importlib.resources.path returns an extant path (GH-20857)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_importlib/test_path.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_path.py b/Lib/test/test_importlib/test_path.py
index c4e7285..abf8086 100644
--- a/Lib/test/test_importlib/test_path.py
+++ b/Lib/test/test_importlib/test_path.py
@@ -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):