summaryrefslogtreecommitdiff
path: root/tests/test_pycode_parser.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2019-07-13 22:02:49 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2019-07-13 22:02:49 +0900
commit8c924f1b3da25b778baedb30cbeca43f5cef6d71 (patch)
tree90db9f46fa3543d7b2bf6e1cb5f669e2283a51d7 /tests/test_pycode_parser.py
parent0bc530f1b7b3303e0f53e42010b629d67e79b835 (diff)
downloadsphinx-git-8c924f1b3da25b778baedb30cbeca43f5cef6d71.tar.gz
Fix autodoc: autodoc_member_order_does not refer order of imports (refs: #6574)
Diffstat (limited to 'tests/test_pycode_parser.py')
-rw-r--r--tests/test_pycode_parser.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_pycode_parser.py b/tests/test_pycode_parser.py
index 8f8c6cbab..b8bece84e 100644
--- a/tests/test_pycode_parser.py
+++ b/tests/test_pycode_parser.py
@@ -344,6 +344,22 @@ def test_async_function_and_method():
'Foo.method': ('def', 6, 7)}
+def test_imports():
+ source = ('import sys\n'
+ 'from os import environment, path\n'
+ '\n'
+ 'import sphinx as Sphinx\n'
+ 'from sphinx.application import Sphinx as App\n')
+ parser = Parser(source)
+ parser.parse()
+ assert parser.definitions == {}
+ assert parser.deforders == {'sys': 0,
+ 'environment': 1,
+ 'path': 2,
+ 'Sphinx': 3,
+ 'App': 4}
+
+
def test_formfeed_char():
source = ('class Foo:\n'
'\f\n'