mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-15 01:42:12 -05:00
Merge branch 'master' into 5770_doctest_refers_highlight_language
This commit is contained in:
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):
|
||||
|
||||
@@ -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
@@ -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' '
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
|
||||
@@ -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
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user