Adapt test for build --without-doc-strings.
authorStefan Krah <skrah@bytereef.org>
Sat, 26 Jan 2013 12:31:44 +0000 (13:31 +0100)
committerStefan Krah <skrah@bytereef.org>
Sat, 26 Jan 2013 12:31:44 +0000 (13:31 +0100)
Lib/test/test_bytes.py
Lib/test/test_support.py

index 520459d039c33ed0e76c95b7818df5dc794a6af1..988b931d1a803a4adad0d5262198a977408d9cca 100644 (file)
@@ -925,6 +925,7 @@ class AssortedBytesTest(unittest.TestCase):
         self.assertEqual(bytes(b"abc") < b"ab", False)
         self.assertEqual(bytes(b"abc") <= b"ab", False)
 
+    @test.test_support.requires_docstrings
     def test_doc(self):
         self.assertIsNotNone(bytearray.__doc__)
         self.assertTrue(bytearray.__doc__.startswith("bytearray("), bytearray.__doc__)
index 270b46bc174c312317355e366e069fcabfb94145..d11343b6b2a34b82779760f76d24643c5d25b869 100644 (file)
@@ -20,6 +20,7 @@ import re
 import time
 import struct
 import _testcapi
+import sysconfig
 try:
     import thread
 except ImportError:
@@ -1111,6 +1112,10 @@ 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.