diff options
| author | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2013-02-03 22:27:20 +0900 |
|---|---|---|
| committer | Takayuki Shimizukawa <shimizukawa@gmail.com> | 2013-02-03 22:27:20 +0900 |
| commit | 70f3f889d10add356438137ac0d4f593ff6406a6 (patch) | |
| tree | 50ad81569ff52bb83cbe4d4a63a2a2a48284b6c8 /tests/test_autodoc.py | |
| parent | e70a43a9c53759d4b4b8f5109a02fe0e793835ff (diff) | |
| download | sphinx-git-70f3f889d10add356438137ac0d4f593ff6406a6.tar.gz | |
Fix autodoc crash if :members: and :special-members: ware both set (by d7ac5e4).
Diffstat (limited to 'tests/test_autodoc.py')
| -rw-r--r-- | tests/test_autodoc.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index f68f7ab5d..fcd064929 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -90,6 +90,8 @@ def process_signature(app, what, name, obj, options, args, retann): def skip_member(app, what, name, obj, skip, options): + if name in ('__special1__', '__special2__'): + return skip if name.startswith('_'): return True if name == 'skipmeth': @@ -519,6 +521,15 @@ def test_generate(): should.append(('method', 'test_autodoc.Class.inheritedmeth')) assert_processes(should, 'class', 'Class') + # test special members + options.special_members = ['__special1__'] + should.append(('method', 'test_autodoc.Class.__special1__')) + assert_processes(should, 'class', 'Class') + options.special_members = ALL + should.append(('method', 'test_autodoc.Class.__special2__')) + assert_processes(should, 'class', 'Class') + options.special_members = False + options.members = [] # test module flags assert_result_contains('.. py:module:: test_autodoc', @@ -750,6 +761,13 @@ class Class(Base): self.inst_attr_string = None """a documented instance attribute""" + def __special1__(self): + """documented special method""" + + def __special2__(self): + # undocumented special method + pass + class CustomDict(dict): """Docstring.""" |
