]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Refresh from importlib_metadata@cpython
authorJason R. Coombs <jaraco@jaraco.com>
Tue, 14 May 2019 14:46:54 +0000 (10:46 -0400)
committerJason R. Coombs <jaraco@jaraco.com>
Tue, 14 May 2019 14:46:54 +0000 (10:46 -0400)
Lib/test/test_importlib/test_zip.py

index e92028cf599a224abb28e0e4ac145d691d7a4daf..db39e190ea7ac9d51033e8809f2ab147cfaa650f 100644 (file)
@@ -7,14 +7,15 @@ from importlib.resources import path
 
 
 class TestZip(unittest.TestCase):
+    root = 'test.test_importlib.data'
+
     def setUp(self):
         # Find the path to the example-*.whl so we can add it to the front of
         # sys.path, where we'll then try to find the metadata thereof.
         self.resources = ExitStack()
         self.addCleanup(self.resources.close)
         wheel = self.resources.enter_context(
-            path('test.test_importlib.data',
-                 'example-21.12-py3-none-any.whl'))
+            path(self.root, 'example-21.12-py3-none-any.whl'))
         sys.path.insert(0, str(wheel))
         self.resources.callback(sys.path.pop, 0)
 
@@ -45,8 +46,7 @@ class TestEgg(TestZip):
         self.resources = ExitStack()
         self.addCleanup(self.resources.close)
         egg = self.resources.enter_context(
-            path('test.test_importlib.data',
-                 'example-21.12-py3.6.egg'))
+            path(self.root, 'example-21.12-py3.6.egg'))
         sys.path.insert(0, str(egg))
         self.resources.callback(sys.path.pop, 0)