diff options
| author | shimizukawa <shimizukawa@gmail.com> | 2013-02-03 20:27:34 +0900 |
|---|---|---|
| committer | shimizukawa <shimizukawa@gmail.com> | 2013-02-03 20:27:34 +0900 |
| commit | 2ed04c65d436082daddea9cd8dc2c83f72a7b493 (patch) | |
| tree | 0fdbe9f5b1ac779ea35c545a1b24397b3d2ef092 /tests | |
| parent | 0598f98f24d778f3f50ab361278b413233033915 (diff) | |
| download | sphinx-2ed04c65d436082daddea9cd8dc2c83f72a7b493.tar.gz | |
Closes #1062: sphinx.ext.autodoc use __init__ method signature for class signature.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_autodoc.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index 591380df..f68f7ab5 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -177,6 +177,20 @@ def test_format_signature(): assert formatsig('class', 'C', C, None, None) == '(a, b=None)' assert formatsig('class', 'C', D, 'a, b', 'X') == '(a, b) -> X' + #__init__ have signature at first line of docstring + class F2: + '''some docstring for F2.''' + def __init__(self, *args, **kw): + ''' + __init__(a1, a2, kw1=True, kw2=False) + + some docstring for __init__. + ''' + class G2(F2, object): + pass + for C in (F2, G2): + assert formatsig('class', 'C', C, None, None) == '(a1, a2, kw1=True, kw2=False)' + # test for methods class H: def foo1(self, b, *c): |
