sys.platform != 'win32' and
not sysconfig.get_config_var('WITH_DOC_STRINGS'))
-HAVE_DOCSTRINGS = (_check_docstrings.__doc__ is not None and
- not MISSING_C_DOCSTRINGS)
+HAVE_PY_DOCSTRINGS = _check_docstrings.__doc__ is not None
+HAVE_DOCSTRINGS = (HAVE_PY_DOCSTRINGS and not MISSING_C_DOCSTRINGS)
requires_docstrings = unittest.skipUnless(HAVE_DOCSTRINGS,
"test requires docstrings")
self.assertEqual(meth.__qualname__, prefix + meth.__name__)
self.assertEqual(meth.__doc__,
('My function docstring'
- if support.HAVE_DOCSTRINGS
+ if support.HAVE_PY_DOCSTRINGS
else None))
self.assertEqual(meth.__annotations__['arg'], int)
with self.subTest(meth=meth):
self.assertEqual(meth.__doc__,
('My function docstring'
- if support.HAVE_DOCSTRINGS
+ if support.HAVE_PY_DOCSTRINGS
else None))
self.assertEqual(meth.__annotations__['arg'], int)
def test_doc(self):
self.assertEqual(CachedCostItem.cost.__doc__,
("The cost of the item."
- if support.HAVE_DOCSTRINGS
+ if support.HAVE_PY_DOCSTRINGS
else None))
def test_module(self):
if dunder:
self.assertIs(dunder, orig)
+ @support.requires_docstrings
def test_attrgetter_signature(self):
operator = self.module
sig = inspect.signature(operator.attrgetter)
sig = inspect.signature(operator.attrgetter('x', 'z', 'y'))
self.assertEqual(str(sig), '(obj, /)')
+ @support.requires_docstrings
def test_itemgetter_signature(self):
operator = self.module
sig = inspect.signature(operator.itemgetter)
sig = inspect.signature(operator.itemgetter(2, 3, 5))
self.assertEqual(str(sig), '(obj, /)')
+ @support.requires_docstrings
def test_methodcaller_signature(self):
operator = self.module
sig = inspect.signature(operator.methodcaller)
--- /dev/null
+Fix compilation process with ``--enable-optimizations`` and
+``--without-docstrings``.