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:
Jason R. Coombs 2019-07-28 14:59:24 -04:00 committed by GitHub
parent b222955355
commit 049460da9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 841 additions and 794 deletions

View file

@ -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']