summaryrefslogtreecommitdiff
path: root/tests/test_pycode.py
diff options
context:
space:
mode:
authorhkm <hkm@mail.ru>2019-12-15 21:47:57 +0300
committerhkm <hkm@mail.ru>2019-12-15 21:47:57 +0300
commit1ca9dacbfe529282ac286a3a61542167e5d6bc65 (patch)
tree45a1859d0598686b6d2512e0238909dae1d70858 /tests/test_pycode.py
parent264329079b6b65da90adfec15baff841a01727cf (diff)
downloadsphinx-git-1ca9dacbfe529282ac286a3a61542167e5d6bc65.tar.gz
Added test case for non ASCII & non UTF8 encoding Windows-1251 in test_pycode section
Diffstat (limited to 'tests/test_pycode.py')
-rw-r--r--tests/test_pycode.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_pycode.py b/tests/test_pycode.py
index abe8ab58b..cdae7d6be 100644
--- a/tests/test_pycode.py
+++ b/tests/test_pycode.py
@@ -31,13 +31,19 @@ def test_ModuleAnalyzer_for_file():
assert analyzer.encoding is None
-def test_ModuleAnalyzer_for_module():
+def test_ModuleAnalyzer_for_module(rootdir):
analyzer = ModuleAnalyzer.for_module('sphinx')
assert analyzer.modname == 'sphinx'
assert analyzer.srcname in (SPHINX_MODULE_PATH,
os.path.abspath(SPHINX_MODULE_PATH))
# source should be loaded via native loader, so don`t know file enconding
assert analyzer.encoding == None
+ path = rootdir / 'test-pycode'
+ sys.path.insert(0, path)
+ analyzer = ModuleAnalyzer.for_module('cp_1251_coded')
+ docs = analyzer.find_attr_docs()
+ sys.path.pop(0)
+ assert docs == {('', 'X'): ['It MUST look like X="\u0425"', '']}
def test_ModuleAnalyzer_for_file_in_egg(rootdir):