- Issue #17041: Fix testing when Python is configured with the

--without-doc-strings option.
This commit is contained in:
Serhiy Storchaka 2013-01-27 19:45:49 +02:00
parent 6d3a8605a5
commit 72121c6c30
6 changed files with 44 additions and 16 deletions

View file

@ -1112,10 +1112,6 @@ def requires_resource(resource):
else:
return unittest.skip("resource {0!r} is not enabled".format(resource))
requires_docstrings = unittest.skipUnless(
sysconfig.get_config_var('WITH_DOC_STRINGS'),
"test requires docstrings")
def cpython_only(test):
"""
Decorator for tests only applicable on CPython.
@ -1193,6 +1189,16 @@ def run_unittest(*classes):
suite.addTest(unittest.makeSuite(cls))
_run_suite(suite)
#=======================================================================
# Check for the presence of docstrings.
HAVE_DOCSTRINGS = (check_impl_detail(cpython=False) or
sys.platform == 'win32' or
sysconfig.get_config_var('WITH_DOC_STRINGS'))
requires_docstrings = unittest.skipUnless(HAVE_DOCSTRINGS,
"test requires docstrings")
#=======================================================================
# doctest driver.