mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
bpo-37697: Sync with importlib_metadata 0.19 (#14993)
* bpo-37697: Sync with importlib_metadata 0.19 * Run make regen-importlib * 📜🤖 Added by blurb_it.
This commit is contained in:
parent
b222955355
commit
049460da9c
7 changed files with 841 additions and 794 deletions
|
@ -2,7 +2,9 @@ import sys
|
|||
import unittest
|
||||
|
||||
from contextlib import ExitStack
|
||||
from importlib.metadata import distribution, entry_points, files, version
|
||||
from importlib.metadata import (
|
||||
distribution, entry_points, files, PackageNotFoundError, version,
|
||||
)
|
||||
from importlib.resources import path
|
||||
|
||||
|
||||
|
@ -22,6 +24,10 @@ class TestZip(unittest.TestCase):
|
|||
def test_zip_version(self):
|
||||
self.assertEqual(version('example'), '21.12')
|
||||
|
||||
def test_zip_version_does_not_match(self):
|
||||
with self.assertRaises(PackageNotFoundError):
|
||||
version('definitely-not-installed')
|
||||
|
||||
def test_zip_entry_points(self):
|
||||
scripts = dict(entry_points()['console_scripts'])
|
||||
entry_point = scripts['example']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue