mirror of https://github.com/python/cpython
Adapt test for build --without-doc-strings.
This commit is contained in:
parent
c59c85c1ac
commit
4216aa1e52
|
@ -925,6 +925,7 @@ class AssortedBytesTest(unittest.TestCase):
|
||||||
self.assertEqual(bytes(b"abc") < b"ab", False)
|
self.assertEqual(bytes(b"abc") < b"ab", False)
|
||||||
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):
|
def test_doc(self):
|
||||||
self.assertIsNotNone(bytearray.__doc__)
|
self.assertIsNotNone(bytearray.__doc__)
|
||||||
self.assertTrue(bytearray.__doc__.startswith("bytearray("), bytearray.__doc__)
|
self.assertTrue(bytearray.__doc__.startswith("bytearray("), bytearray.__doc__)
|
||||||
|
|
|
@ -20,6 +20,7 @@ import re
|
||||||
import time
|
import time
|
||||||
import struct
|
import struct
|
||||||
import _testcapi
|
import _testcapi
|
||||||
|
import sysconfig
|
||||||
try:
|
try:
|
||||||
import thread
|
import thread
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
@ -1111,6 +1112,10 @@ def requires_resource(resource):
|
||||||
else:
|
else:
|
||||||
return unittest.skip("resource {0!r} is not enabled".format(resource))
|
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):
|
def cpython_only(test):
|
||||||
"""
|
"""
|
||||||
Decorator for tests only applicable on CPython.
|
Decorator for tests only applicable on CPython.
|
||||||
|
|
Loading…
Reference in New Issue