summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-06-18 20:30:53 (GMT)
committerGitHub <noreply@github.com>2021-06-18 20:30:53 (GMT)
commitbf55a799e0c19285b094d71f794c301c1afaa28d (patch)
treeab202f24e7b67510ac0a19649c3f159bc01949c2 /Lib/test/test_importlib
parentbba726710b33a4f52b4a15fb5d94ee402e38d552 (diff)
downloadcpython-bf55a799e0c19285b094d71f794c301c1afaa28d.zip
cpython-bf55a799e0c19285b094d71f794c301c1afaa28d.tar.gz
cpython-bf55a799e0c19285b094d71f794c301c1afaa28d.tar.bz2
bpo-44451: Reset DeprecationWarning filters in test_importlib.test_entry_points_by_index (GH-26784)
This avoids the following error if DeprecationWarnings are ignored. ====================================================================== ERROR: test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) Prior versions of Distribution.entry_points would return a ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-3.10.0b3/Lib/test/test_importlib/test_metadata_api.py", line 145, in test_entry_points_by_index expected = next(iter(caught)) StopIteration ---------------------------------------------------------------------- Ran 1402 tests in 2.125s FAILED (errors=1, skipped=18, expected failures=1) (cherry picked from commit df1502e47fc1e0cf1e7d460ae04530c3e2e4a7c6) Co-authored-by: Miro HronĨok <miro@hroncok.cz>
Diffstat (limited to 'Lib/test/test_importlib')
-rw-r--r--Lib/test/test_importlib/test_metadata_api.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py
index 3506493..2bfc44b 100644
--- a/Lib/test/test_importlib/test_metadata_api.py
+++ b/Lib/test/test_importlib/test_metadata_api.py
@@ -139,6 +139,7 @@ class APITests(
"""
eps = distribution('distinfo-pkg').entry_points
with warnings.catch_warnings(record=True) as caught:
+ warnings.filterwarnings("default", category=DeprecationWarning)
eps[0]
# check warning