summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib/test_zip.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2019-07-28 18:59:24 (GMT)
committerGitHub <noreply@github.com>2019-07-28 18:59:24 (GMT)
commit049460da9c7b5f51732e2966195c44713af9dc4c (patch)
tree5fb30710967235710cb665d70218a8633ccdffc3 /Lib/test/test_importlib/test_zip.py
parentb222955355c8077a3ceca79195731663d7c3dd5f (diff)
downloadcpython-049460da9c7b5f51732e2966195c44713af9dc4c.zip
cpython-049460da9c7b5f51732e2966195c44713af9dc4c.tar.gz
cpython-049460da9c7b5f51732e2966195c44713af9dc4c.tar.bz2
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.
Diffstat (limited to 'Lib/test/test_importlib/test_zip.py')
-rw-r--r--Lib/test/test_importlib/test_zip.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_importlib/test_zip.py b/Lib/test/test_importlib/test_zip.py
index bcf7cf3..9568c22 100644
--- a/Lib/test/test_importlib/test_zip.py
+++ b/Lib/test/test_importlib/test_zip.py
@@ -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']