bpo-44451: Reset DeprecationWarning filters in test_importlib.test_entry_points_by_index#26784
Conversation
…try_points_by_index
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)
|
Also in python/importlib_metadata#325 |
There was a problem hiding this comment.
LGTM.
cc @warsaw @jaraco: I'm not comfortable to merge this change, since there is the importlib_metadata package on PyPI and I don't how it's maintained and by who. Miro already created a backport PR! python/importlib_metadata#325
Without the PR, the test fails with -Wignore:
$ ./python -Wignore -m test test_importlib -m test_entry_points_by_index
...
test test_importlib failed -- Traceback (most recent call last):
File "/home/vstinner/python/main/Lib/test/test_importlib/test_metadata_api.py", line 145, in test_entry_points_by_index
expected = next(iter(caught))
StopIteration
Tests result: FAILURE
With the PR, the test pass as expected:
$ ./python -Wignore -m test test_importlib -m test_entry_points_by_index
...
Tests result: SUCCESS
test_httpservers failed on 32-bit and 64-bit Windows jobs, no idea why: |
I'm all but certain this failure is spurious, unrelated, and thus ignorable.
Thanks for that... although now I notice that the third-party module neither needs the behavior nor implements it for Regardless, I'd like to make the approach consistent. I'll work on that in |
|
I don't see any way to re-run the failed tests, so I'm going to assume they're spurious and proceed. |
…try_points_by_index (pythonGH-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 df1502e) Co-authored-by: Miro Hrončok <miro@hroncok.cz>
|
GH-26790 is a backport of this pull request to the 3.10 branch. |
…try_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 df1502e) Co-authored-by: Miro Hrončok <miro@hroncok.cz>
…try_points_by_index (pythonGH-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 avoids the following error if DeprecationWarnings are ignored.
https://bugs.python.org/issue44451