diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-03-13 16:31:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-13 16:31:45 (GMT) |
commit | f917efccf8d5aa2b8315d2a832a520339e668187 (patch) | |
tree | 25319b76b7c107939278df8ebaaeed52619462bb /Lib/test/test_importlib/test_main.py | |
parent | 2256a2876b5214a5a7492bf78bd86cf8beb690bf (diff) | |
download | cpython-f917efccf8d5aa2b8315d2a832a520339e668187.zip cpython-f917efccf8d5aa2b8315d2a832a520339e668187.tar.gz cpython-f917efccf8d5aa2b8315d2a832a520339e668187.tar.bz2 |
bpo-43428: Sync with importlib_metadata 3.7. (GH-24782)
* bpo-43428: Sync with importlib_metadata 3.7.2 (67234b6)
* Add blurb
* Reformat blurb to create separate paragraphs for each change included.
Diffstat (limited to 'Lib/test/test_importlib/test_main.py')
-rw-r--r-- | Lib/test/test_importlib/test_main.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_importlib/test_main.py b/Lib/test/test_importlib/test_main.py index c937361..02e8a57 100644 --- a/Lib/test/test_importlib/test_main.py +++ b/Lib/test/test_importlib/test_main.py @@ -3,6 +3,7 @@ import json import pickle import textwrap import unittest +import warnings import importlib.metadata try: @@ -58,13 +59,11 @@ class ImportTests(fixtures.DistInfoPkg, unittest.TestCase): importlib.import_module('does_not_exist') def test_resolve(self): - entries = dict(entry_points()['entries']) - ep = entries['main'] + ep = entry_points(group='entries')['main'] self.assertEqual(ep.load().__name__, "main") def test_entrypoint_with_colon_in_name(self): - entries = dict(entry_points()['entries']) - ep = entries['ns:sub'] + ep = entry_points(group='entries')['ns:sub'] self.assertEqual(ep.value, 'mod:main') def test_resolve_without_attr(self): @@ -250,7 +249,8 @@ class TestEntryPoints(unittest.TestCase): json should not expect to be able to dump an EntryPoint """ with self.assertRaises(Exception): - json.dumps(self.ep) + with warnings.catch_warnings(record=True): + json.dumps(self.ep) def test_module(self): assert self.ep.module == 'value' |