diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-07-03 00:52:07 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-07-26 20:51:40 +0900 |
| commit | 57667b576660e898f48c2f6c0f8d58e6826e4d20 (patch) | |
| tree | 4a563d50b8f6d98012c0f7cb3b5527151affd3e2 /tests/test_pycode.py | |
| parent | ae3b761184cf0f0bca76685da8d79cd008ed8b1a (diff) | |
| download | sphinx-git-57667b576660e898f48c2f6c0f8d58e6826e4d20.tar.gz | |
Add testcase for oneliner
Diffstat (limited to 'tests/test_pycode.py')
| -rw-r--r-- | tests/test_pycode.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_pycode.py b/tests/test_pycode.py index 45174241f..152a92a27 100644 --- a/tests/test_pycode.py +++ b/tests/test_pycode.py @@ -105,7 +105,9 @@ def test_ModuleAnalyzer_find_attr_docs(): '\n' 'def baz():\n' ' """function baz"""\n' - ' pass\n') + ' pass\n' + '\n' + 'class Qux: attr1 = 1; attr2 = 2') analyzer = ModuleAnalyzer.for_string(code, 'module') docs = analyzer.find_attr_docs() assert set(docs) == {('Foo', 'attr1'), @@ -131,4 +133,7 @@ def test_ModuleAnalyzer_find_attr_docs(): 'Foo.attr8': 8, 'Foo.attr9': 10, 'Foo.bar': 11, - 'baz': 12} + 'baz': 12, + 'Qux': 13, + 'Qux.attr1': 14, + 'Qux.attr2': 15} |
