GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Consider adding `doctest.skip_if` decorator · Issue #117364 · python/cpython Open Labels 3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement DescriptionFeature or enhancementRight now there's no way to skip the whole test / class doctest. You can only skip individual statements with This causes problems in several use-cases:
Right now we have this hack: cpython/Lib/test/test_doctest/test_doctest.py Lines 727 to 730 in 2e9be80
cpython/Lib/test/test_doctest/test_doctest.py Lines 1999 to 2003 in 2e9be80
cpython/Lib/test/test_doctest/test_doctest.py Lines 2938 to 2943 in 2e9be80
However, this is just test functions. For library functions it would be much harder to do. Since #117297 we now have correct skipped count for So, I propose adding this decorator to def skip_if(condition): def decorator(func): if condition and HAVE_DOCSTRINGS: func.__doc__ = ">>> pass # doctest: +SKIP" return func return decorator It will allow us skipping some tests conditionally with the proper reported results. Refs #116758 Linked PRsReacted by Aleksei Stepanov Activity
MetadataMetadataAssigneesLabels3.13only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement ProjectsMilestoneRelationshipsDevelopmentIssue actions | ||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |