mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
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)
This commit is contained in:
parent
c106cf31f8
commit
df1502e47f
2 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue