gh-117294: Report DocTestCase as skipped if all examples in the doctest are skipped (GH-117297)

This commit is contained in:
Malcolm Smith 2024-03-28 19:59:12 +00:00 committed by GitHub
parent efcc96844e
commit 29829b58a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 87 additions and 7 deletions

View file

@ -31,7 +31,7 @@ verbose = test.support.verbose
# Retrieve some helpers from other test cases
from test.test_doctest import (test_doctest,
sample_doctest, sample_doctest_no_doctests,
sample_doctest_no_docstrings)
sample_doctest_no_docstrings, sample_doctest_skip)
def _run_object_doctest(obj, module):
@ -110,7 +110,7 @@ class ZipSupportTests(unittest.TestCase):
# The sample doctest files rewritten to include in the zipped version.
sample_sources = {}
for mod in [sample_doctest, sample_doctest_no_doctests,
sample_doctest_no_docstrings]:
sample_doctest_no_docstrings, sample_doctest_skip]:
src = inspect.getsource(mod)
src = src.replace("test.test_doctest.test_doctest", "test_zipped_doctest")
# Rewrite the module name so that, for example,