summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-04-24 14:13:51 (GMT)
committerGitHub <noreply@github.com>2021-04-24 14:13:51 (GMT)
commitc6ca368867bd68d44f333df840aa85d425a51410 (patch)
tree74312cafb5adb28257beed73ffdcb3bbc285807c /Lib/test/test_importlib
parentce9a0643496ba802ea97a3da20eace3a1117ea48 (diff)
downloadcpython-c6ca368867bd68d44f333df840aa85d425a51410.zip
cpython-c6ca368867bd68d44f333df840aa85d425a51410.tar.gz
cpython-c6ca368867bd68d44f333df840aa85d425a51410.tar.bz2
bpo-43780: Sync with importlib_metadata 3.10 (GH-25297)
* bpo-43780: Sync with importlib_metadata 3.10. * Add blurb * Apply changes from importlib_metadata 3.10.1.
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r--Lib/test/test_importlib/fixtures.py7
-rw-r--r--Lib/test/test_importlib/test_metadata_api.py7
2 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/fixtures.py b/Lib/test/test_importlib/fixtures.py
index b50afda..1ae70c7 100644
--- a/Lib/test/test_importlib/fixtures.py
+++ b/Lib/test/test_importlib/fixtures.py
@@ -86,6 +86,10 @@ class DistInfoPkg(OnSysPath, SiteDir):
Version: 1.0.0
Requires-Dist: wheel >= 1.0
Requires-Dist: pytest; extra == 'test'
+ Keywords: sample package
+
+ Once upon a time
+ There was a distinfo pkg
""",
"RECORD": "mod.py,sha256=abc,20\n",
"entry_points.txt": """
@@ -157,6 +161,9 @@ class EggInfoPkg(OnSysPath, SiteDir):
Version: 1.0.0
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
+ Keywords: sample package
+ Description: Once upon a time
+ There was an egginfo package
""",
"SOURCES.txt": """
mod.py
diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py
index b54c3bd..657c166 100644
--- a/Lib/test/test_importlib/test_metadata_api.py
+++ b/Lib/test/test_importlib/test_metadata_api.py
@@ -2,6 +2,7 @@ import re
import textwrap
import unittest
import warnings
+import importlib
from . import fixtures
from importlib.metadata import (
@@ -260,3 +261,9 @@ class OffSysPathTests(fixtures.DistInfoPkgOffPath, unittest.TestCase):
dist_info_path = self.site_dir / 'distinfo_pkg-1.0.0.dist-info'
dist = Distribution.at(str(dist_info_path))
assert dist.version == '1.0.0'
+
+
+class InvalidateCache(unittest.TestCase):
+ def test_invalidate_cache(self):
+ # No externally observable behavior, but ensures test coverage...
+ importlib.invalidate_caches()