diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-15 22:40:46 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-15 22:40:46 +0900 |
commit | 415ebc15c59e8b2e7fd2eb1df76017a331f8b131 (patch) | |
tree | 5934d437249ff312ed5d0fe157d800752fbf796f /tests/test_autodoc.py | |
parent | 4d933716b8074eabfa78093bf271908c6d0bc6e6 (diff) | |
parent | 77e0139a26a080e5b7c0292ebd08fbb2eb540be9 (diff) | |
download | sphinx-git-415ebc15c59e8b2e7fd2eb1df76017a331f8b131.tar.gz |
Merge pull request #5784 from tk0miya/refactor_hack_for_py2
Refactor hack for py2
Diffstat (limited to 'tests/test_autodoc.py')
-rw-r--r-- | tests/test_autodoc.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index feaab19f4..4fd353dc1 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -1028,16 +1028,13 @@ def test_autodoc_member_order(app): @pytest.mark.sphinx('html', testroot='ext-autodoc') def test_autodoc_module_scope(app): - def convert(s): - return re.sub('<.*>', '<FILTERED>', s) # for py2/py3 - app.env.temp_data['autodoc:module'] = 'target' actual = do_autodoc(app, 'attribute', 'Class.mdocattr') - assert list(map(convert, actual)) == [ + assert list(actual) == [ u'', u'.. py:attribute:: Class.mdocattr', u' :module: target', - u' :annotation: = <FILTERED>', + u' :annotation: = <_io.StringIO object>', u'', u' should be documented as well - süß', u' ' @@ -1046,17 +1043,14 @@ def test_autodoc_module_scope(app): @pytest.mark.sphinx('html', testroot='ext-autodoc') def test_autodoc_class_scope(app): - def convert(s): - return re.sub('<.*>', '<FILTERED>', s) # for py2/py3 - app.env.temp_data['autodoc:module'] = 'target' app.env.temp_data['autodoc:class'] = 'Class' actual = do_autodoc(app, 'attribute', 'mdocattr') - assert list(map(convert, actual)) == [ + assert list(actual) == [ u'', u'.. py:attribute:: Class.mdocattr', u' :module: target', - u' :annotation: = <FILTERED>', + u' :annotation: = <_io.StringIO object>', u'', u' should be documented as well - süß', u' ' |