summaryrefslogtreecommitdiff
path: root/Lib/test/support.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-27 20:04:26 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-27 20:04:26 +0200
commitf011881d7d48f5ad529ce1b4e8da313a62526350 (patch)
treedf8d5813abaea34519d7fbc72f108c1e7f3d7384 /Lib/test/support.py
parentef0a44c629b84036edee5b4513159299993a7524 (diff)
parent26f116651030c77c93f0a98026baf7812963a30c (diff)
downloadcpython-git-f011881d7d48f5ad529ce1b4e8da313a62526350.tar.gz
Issue #17041: Fix testing when Python is configured with the
--without-doc-strings.
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r--Lib/test/support.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py
index a4d030aeac..7f60111712 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -597,10 +597,6 @@ requires_bz2 = unittest.skipUnless(bz2, 'requires bz2')
requires_lzma = unittest.skipUnless(lzma, 'requires lzma')
-requires_docstrings = unittest.skipUnless(
- sysconfig.get_config_var('WITH_DOC_STRINGS'),
- "test requires docstrings")
-
is_jython = sys.platform.startswith('java')
# Filename used for testing
@@ -1599,6 +1595,16 @@ def run_unittest(*classes):
_filter_suite(suite, case_pred)
_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.