Merge branch 'master' into 5770_doctest_refers_highlight_language

This commit is contained in:
Takeshi KOMIYA authored and GitHub committed 2018-12-16 00:32:10 +09:00
commit c70e65fc6c
179 files changed
+2014 -2212

No files matched your search

@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import enum
from six import StringIO, add_metaclass
from io import StringIO
from sphinx.util import save_traceback # NOQA
@@ -45,9 +44,9 @@ class CustomDataDescriptorMeta(type):
"""Descriptor metaclass docstring."""
@add_metaclass(CustomDataDescriptorMeta)
class CustomDataDescriptor2(CustomDataDescriptor):
"""Descriptor class with custom metaclass docstring."""
__metaclass__ = CustomDataDescriptorMeta
def _funky_classmethod(name, b, c, d, docstring=None):
+2 -3
View File
@@ -1,8 +1,7 @@
# -*- coding: utf-8 -*-
import enum
from six import StringIO, add_metaclass
from io import StringIO
__all__ = ['Class']
@@ -43,9 +42,9 @@ class CustomDataDescriptorMeta(type):
"""Descriptor metaclass docstring."""
@add_metaclass(CustomDataDescriptorMeta)
class CustomDataDescriptor2(CustomDataDescriptor):
"""Descriptor class with custom metaclass docstring."""
__metaclass__ = CustomDataDescriptorMeta
def _funky_classmethod(name, b, c, d, docstring=None):
+4 -10
View File
@@ -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' '
-1
View File
@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import gettext
import os
-1
View File
@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import os
import re
-1
View File
@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import pytest
-1
View File
@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import pytest
-1
View File
@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import os
import re
-2
View File
@@ -9,8 +9,6 @@
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
from collections import namedtuple
import pytest
+2 -1
View File
@@ -9,8 +9,9 @@
:license: BSD, see LICENSE for details.
"""
from io import StringIO
import pytest
from six import StringIO
from sphinx.ext.autosummary import mangle_signature, import_by_name, extract_summary
from sphinx.testing.util import etree_parse
-1
View File
@@ -9,7 +9,6 @@
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import os
import pickle
+2 -1
View File
@@ -9,8 +9,9 @@
:license: BSD, see LICENSE for details.
"""
from io import StringIO
import pytest
from six import StringIO
from sphinx.io import SphinxRSTFileInput
+2 -1
View File
@@ -11,9 +11,10 @@
import sys
import time
from io import StringIO
import pytest
from six import text_type, StringIO
from six import text_type
from sphinx import application
from sphinx.cmd import quickstart as qs
+1 -6
View File
@@ -15,8 +15,6 @@ import tempfile
import pytest
from mock import patch
from six import PY2
import sphinx
from sphinx.errors import PycodeError
from sphinx.testing.util import strip_escseq
@@ -65,10 +63,7 @@ def test_display_chunk():
def test_get_module_source():
if PY2:
assert get_module_source('sphinx') == ('file', sphinx.__file__.replace('.pyc', '.py'))
else:
assert get_module_source('sphinx') == ('file', sphinx.__file__)
assert get_module_source('sphinx') == ('file', sphinx.__file__)
# failed to obtain source information from builtin modules
with pytest.raises(PycodeError):
-1
View File
@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import datetime
import os
-1
View File
@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import pytest
-1
View File
@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import codecs
import os
-1
View File
@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import print_function
import pytest