mirror of https://github.com/python/cpython
Refresh from importlib_metadata@cpython
This commit is contained in:
parent
b462010cd7
commit
c2bf9a52d4
|
@ -7,14 +7,15 @@ from importlib.resources import path
|
||||||
|
|
||||||
|
|
||||||
class TestZip(unittest.TestCase):
|
class TestZip(unittest.TestCase):
|
||||||
|
root = 'test.test_importlib.data'
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
# Find the path to the example-*.whl so we can add it to the front of
|
# 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.
|
# sys.path, where we'll then try to find the metadata thereof.
|
||||||
self.resources = ExitStack()
|
self.resources = ExitStack()
|
||||||
self.addCleanup(self.resources.close)
|
self.addCleanup(self.resources.close)
|
||||||
wheel = self.resources.enter_context(
|
wheel = self.resources.enter_context(
|
||||||
path('test.test_importlib.data',
|
path(self.root, 'example-21.12-py3-none-any.whl'))
|
||||||
'example-21.12-py3-none-any.whl'))
|
|
||||||
sys.path.insert(0, str(wheel))
|
sys.path.insert(0, str(wheel))
|
||||||
self.resources.callback(sys.path.pop, 0)
|
self.resources.callback(sys.path.pop, 0)
|
||||||
|
|
||||||
|
@ -45,8 +46,7 @@ class TestEgg(TestZip):
|
||||||
self.resources = ExitStack()
|
self.resources = ExitStack()
|
||||||
self.addCleanup(self.resources.close)
|
self.addCleanup(self.resources.close)
|
||||||
egg = self.resources.enter_context(
|
egg = self.resources.enter_context(
|
||||||
path('test.test_importlib.data',
|
path(self.root, 'example-21.12-py3.6.egg'))
|
||||||
'example-21.12-py3.6.egg'))
|
|
||||||
sys.path.insert(0, str(egg))
|
sys.path.insert(0, str(egg))
|
||||||
self.resources.callback(sys.path.pop, 0)
|
self.resources.callback(sys.path.pop, 0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue