mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #4822 from tk0miya/4543_fix_testcase_for_partialmethod
Fix #4543: testcase for partialmethod is failed with py3.6.5
This commit is contained in:
commit
31d6576871
@ -313,7 +313,10 @@ class Signature(object):
|
|||||||
try:
|
try:
|
||||||
self.signature = inspect.signature(subject)
|
self.signature = inspect.signature(subject)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
if hasattr(subject, '_partialmethod'): # partialmethod with no argument
|
# Until python 3.6.4, cpython has been crashed on inspection for
|
||||||
|
# partialmethods not having any arguments.
|
||||||
|
# https://bugs.python.org/issue33009
|
||||||
|
if hasattr(subject, '_partialmethod'):
|
||||||
self.signature = None
|
self.signature = None
|
||||||
self.partialmethod_with_noargs = True
|
self.partialmethod_with_noargs = True
|
||||||
else:
|
else:
|
||||||
|
@ -952,7 +952,10 @@ def test_partialmethod():
|
|||||||
' Update state of cell to *state*.',
|
' Update state of cell to *state*.',
|
||||||
' ',
|
' ',
|
||||||
]
|
]
|
||||||
if sys.version_info < (3, 5, 4):
|
if (sys.version_info < (3, 5, 4) or
|
||||||
|
(3, 6, 5) <= sys.version_info < (3, 7) or
|
||||||
|
(3, 7, 0, 'beta', 3) <= sys.version_info):
|
||||||
|
# TODO: this condition should be updated after 3.7-final release.
|
||||||
expected = '\n'.join(expected).replace(' -> None', '').split('\n')
|
expected = '\n'.join(expected).replace(' -> None', '').split('\n')
|
||||||
|
|
||||||
assert call_autodoc('class', 'target.partialmethod.Cell') == expected
|
assert call_autodoc('class', 'target.partialmethod.Cell') == expected
|
||||||
|
Loading…
Reference in New Issue
Block a user