aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_importlib/test_main.py10
-rw-r--r--Lib/test/test_importlib/test_metadata_api.py56
2 files changed, 0 insertions, 66 deletions
diff --git a/Lib/test/test_importlib/test_main.py b/Lib/test/test_importlib/test_main.py
index d9d067c4b23..30b68b6ae7d 100644
--- a/Lib/test/test_importlib/test_main.py
+++ b/Lib/test/test_importlib/test_main.py
@@ -1,8 +1,6 @@
import re
-import json
import pickle
import unittest
-import warnings
import importlib.metadata
try:
@@ -260,14 +258,6 @@ class TestEntryPoints(unittest.TestCase):
"""EntryPoints should be hashable"""
hash(self.ep)
- def test_json_dump(self):
- """
- json should not expect to be able to dump an EntryPoint
- """
- with self.assertRaises(Exception):
- with warnings.catch_warnings(record=True):
- json.dumps(self.ep)
-
def test_module(self):
assert self.ep.module == 'value'
diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py
index 69c78e9820c..71c47e62d27 100644
--- a/Lib/test/test_importlib/test_metadata_api.py
+++ b/Lib/test/test_importlib/test_metadata_api.py
@@ -124,62 +124,6 @@ class APITests(
def test_entry_points_missing_group(self):
assert entry_points(group='missing') == ()
- def test_entry_points_dict_construction(self):
- """
- Prior versions of entry_points() returned simple lists and
- allowed casting those lists into maps by name using ``dict()``.
- Capture this now deprecated use-case.
- """
- with suppress_known_deprecation() as caught:
- eps = dict(entry_points(group='entries'))
-
- assert 'main' in eps
- assert eps['main'] == entry_points(group='entries')['main']
-
- # check warning
- expected = next(iter(caught))
- assert expected.category is DeprecationWarning
- assert "Construction of dict of EntryPoints is deprecated" in str(expected)
-
- def test_entry_points_by_index(self):
- """
- Prior versions of Distribution.entry_points would return a
- tuple that allowed access by index.
- Capture this now deprecated use-case
- See python/importlib_metadata#300 and bpo-44246.
- """
- eps = distribution('distinfo-pkg').entry_points
- with suppress_known_deprecation() as caught:
- eps[0]
-
- # check warning
- expected = next(iter(caught))
- assert expected.category is DeprecationWarning
- assert "Accessing entry points by index is deprecated" in str(expected)
-
- def test_entry_points_groups_getitem(self):
- """
- Prior versions of entry_points() returned a dict. Ensure
- that callers using '.__getitem__()' are supported but warned to
- migrate.
- """
- with suppress_known_deprecation():
- entry_points()['entries'] == entry_points(group='entries')
-
- with self.assertRaises(KeyError):
- entry_points()['missing']
-
- def test_entry_points_groups_get(self):
- """
- Prior versions of entry_points() returned a dict. Ensure
- that callers using '.get()' are supported but warned to
- migrate.
- """
- with suppress_known_deprecation():
- entry_points().get('missing', 'default') == 'default'
- entry_points().get('entries', 'default') == entry_points()['entries']
- entry_points().get('missing', ()) == ()
-
def test_entry_points_allows_no_attributes(self):
ep = entry_points().select(group='entries', name='main')
with self.assertRaises(AttributeError):