From 57667b576660e898f48c2f6c0f8d58e6826e4d20 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Mon, 3 Jul 2017 00:52:07 +0900 Subject: [PATCH] Add testcase for oneliner --- tests/test_pycode.py | 9 +++++++-- 1 file 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}