diff options
Diffstat (limited to 'tests')
103 files changed, 141 insertions, 911 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index dd1a04513..ebbc9e2c7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,11 +1,3 @@ -""" - pytest config for sphinx/tests - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - import os import shutil diff --git a/tests/ext_napoleon_pep526_data_google.py b/tests/ext_napoleon_pep526_data_google.py index 0a4676d89..bb55b0fc2 100644 --- a/tests/ext_napoleon_pep526_data_google.py +++ b/tests/ext_napoleon_pep526_data_google.py @@ -1,6 +1,4 @@ -""" -Test module for napoleon PEP 526 compatibility with google style -""" +"""Test module for napoleon PEP 526 compatibility with google style""" module_level_var: int = 99 """This is an example module level variable""" diff --git a/tests/ext_napoleon_pep526_data_numpy.py b/tests/ext_napoleon_pep526_data_numpy.py index a421f53fe..b3093a7f4 100644 --- a/tests/ext_napoleon_pep526_data_numpy.py +++ b/tests/ext_napoleon_pep526_data_numpy.py @@ -1,6 +1,4 @@ -""" -Test module for napoleon PEP 526 compatibility with numpy style -""" +"""Test module for napoleon PEP 526 compatibility with numpy style""" module_level_var: int = 99 """This is an example module level variable""" diff --git a/tests/roots/test-inheritance/dummy/test_nested.py b/tests/roots/test-inheritance/dummy/test_nested.py index 1e732aab5..89289fe44 100644 --- a/tests/roots/test-inheritance/dummy/test_nested.py +++ b/tests/roots/test-inheritance/dummy/test_nested.py @@ -1,5 +1,4 @@ -""" - Test with nested classes. +"""Test with nested classes. """ diff --git a/tests/test_api_translator.py b/tests/test_api_translator.py index dd721355b..aad5a2ccc 100644 --- a/tests/test_api_translator.py +++ b/tests/test_api_translator.py @@ -1,12 +1,4 @@ -""" - test_api_translator - ~~~~~~~~~~~~~~~~~~~ - - Test the Sphinx API for translator. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the Sphinx API for translator.""" import sys diff --git a/tests/test_application.py b/tests/test_application.py index fc85f193d..365fff8ea 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -1,12 +1,4 @@ -""" - test_application - ~~~~~~~~~~~~~~~~ - - Test the Sphinx class. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the Sphinx class.""" from unittest.mock import Mock diff --git a/tests/test_build.py b/tests/test_build.py index 76de332ee..f2af19565 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -1,12 +1,4 @@ -""" - test_build - ~~~~~~~~~~ - - Test all builders. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test all builders.""" import sys from textwrap import dedent diff --git a/tests/test_build_changes.py b/tests/test_build_changes.py index 65307ba92..a4a07619b 100644 --- a/tests/test_build_changes.py +++ b/tests/test_build_changes.py @@ -1,12 +1,4 @@ -""" - test_build_changes - ~~~~~~~~~~~~~~~~~~ - - Test the ChangesBuilder class. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the ChangesBuilder class.""" import pytest diff --git a/tests/test_build_dirhtml.py b/tests/test_build_dirhtml.py index a7a90623c..25598f795 100644 --- a/tests/test_build_dirhtml.py +++ b/tests/test_build_dirhtml.py @@ -1,12 +1,4 @@ -""" - test_build_dirhtml - ~~~~~~~~~~~~~~~~~~ - - Test dirhtml builder. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test dirhtml builder.""" import posixpath diff --git a/tests/test_build_epub.py b/tests/test_build_epub.py index 851e8ac9d..4ba29df85 100644 --- a/tests/test_build_epub.py +++ b/tests/test_build_epub.py @@ -1,12 +1,4 @@ -""" - test_build_html - ~~~~~~~~~~~~~~~ - - Test the HTML builder and check output against XPath. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the HTML builder and check output against XPath.""" import os import subprocess diff --git a/tests/test_build_gettext.py b/tests/test_build_gettext.py index 9398dfe5f..6d80324bd 100644 --- a/tests/test_build_gettext.py +++ b/tests/test_build_gettext.py @@ -1,12 +1,4 @@ -""" - test_build_gettext - ~~~~~~~~~~~~~~~~~~ - - Test the build process with gettext builder with the test root. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the build process with gettext builder with the test root.""" import gettext import os diff --git a/tests/test_build_html.py b/tests/test_build_html.py index cb8f347b7..0e9a8ff63 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -1,12 +1,4 @@ -""" - test_build_html - ~~~~~~~~~~~~~~~ - - Test the HTML builder and check output against XPath. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the HTML builder and check output against XPath.""" import os import re @@ -220,9 +212,9 @@ def test_html4_output(app, status, warning): (".//li/p/code/span[@class='pre']", '^a/$'), (".//li/p/code/em/span[@class='pre']", '^varpart$'), (".//li/p/code/em/span[@class='pre']", '^i$'), - (".//a[@href='https://www.python.org/dev/peps/pep-0008']" + (".//a[@href='https://peps.python.org/pep-0008']" "[@class='pep reference external']/strong", 'PEP 8'), - (".//a[@href='https://www.python.org/dev/peps/pep-0008']" + (".//a[@href='https://peps.python.org/pep-0008']" "[@class='pep reference external']/strong", 'Python Enhancement Proposal #8'), (".//a[@href='https://datatracker.ietf.org/doc/html/rfc1.html']" diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index 5db8546e9..50b2b693a 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -1,12 +1,4 @@ -""" - test_build_latex - ~~~~~~~~~~~~~~~~ - - Test the build process with LaTeX builder with the test root. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the build process with LaTeX builder with the test root.""" import os import re diff --git a/tests/test_build_linkcheck.py b/tests/test_build_linkcheck.py index 358db6a4e..d5684ba6c 100644 --- a/tests/test_build_linkcheck.py +++ b/tests/test_build_linkcheck.py @@ -1,12 +1,4 @@ -""" - test_build_linkcheck - ~~~~~~~~~~~~~~~~~~~~ - - Test the build process with manpage builder with the test root. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the build process with manpage builder with the test root.""" import http.server import json diff --git a/tests/test_build_manpage.py b/tests/test_build_manpage.py index 1a14c9bf7..c6139c2bf 100644 --- a/tests/test_build_manpage.py +++ b/tests/test_build_manpage.py @@ -1,12 +1,4 @@ -""" - test_build_manpage - ~~~~~~~~~~~~~~~~~~ - - Test the build process with manpage builder with the test root. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the build process with manpage builder with the test root.""" import pytest diff --git a/tests/test_build_texinfo.py b/tests/test_build_texinfo.py index 601de1587..ccdbd9bd3 100644 --- a/tests/test_build_texinfo.py +++ b/tests/test_build_texinfo.py @@ -1,12 +1,4 @@ -""" - test_build_texinfo - ~~~~~~~~~~~~~~~~~~ - - Test the build process with Texinfo builder with the test root. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the build process with Texinfo builder with the test root.""" import os import re diff --git a/tests/test_build_text.py b/tests/test_build_text.py index c080d2ad2..0578e425e 100644 --- a/tests/test_build_text.py +++ b/tests/test_build_text.py @@ -1,12 +1,4 @@ -""" - test_build_text - ~~~~~~~~~~~~~~~ - - Test the build process with Text builder with the test root. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the build process with Text builder with the test root.""" import pytest from docutils.utils import column_width diff --git a/tests/test_builder.py b/tests/test_builder.py index 4927e5d1d..c866a9720 100644 --- a/tests/test_builder.py +++ b/tests/test_builder.py @@ -1,12 +1,4 @@ -""" - test_builder - ~~~~~~~~ - - Test the Builder class. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the Builder class.""" import pytest diff --git a/tests/test_catalogs.py b/tests/test_catalogs.py index 319e6a07d..74aa7077a 100644 --- a/tests/test_catalogs.py +++ b/tests/test_catalogs.py @@ -1,12 +1,4 @@ -""" - test_build_base - ~~~~~~~~~~~~~~~ - - Test the base build process. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the base build process.""" import shutil import pytest diff --git a/tests/test_config.py b/tests/test_config.py index 97e911eb5..7981dd7a9 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,13 +1,4 @@ -""" - test_config - ~~~~~~~~~~~ - - Test the sphinx.config.Config class and its handling in the - Application class. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the sphinx.config.Config class.""" from unittest import mock diff --git a/tests/test_correct_year.py b/tests/test_correct_year.py index bcb217036..3855df913 100644 --- a/tests/test_correct_year.py +++ b/tests/test_correct_year.py @@ -1,12 +1,4 @@ -""" - test_correct_year - ~~~~~~~~~~~~~~~~~ - - Test copyright year adjustment - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test copyright year adjustment""" import pytest diff --git a/tests/test_directive_code.py b/tests/test_directive_code.py index 5f519d3b9..98a9aa899 100644 --- a/tests/test_directive_code.py +++ b/tests/test_directive_code.py @@ -1,12 +1,4 @@ -""" - test_directive_code - ~~~~~~~~~~~~~~~~~~~ - - Test the code-block directive. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the code-block directive.""" import os diff --git a/tests/test_directive_only.py b/tests/test_directive_only.py index 164220e33..2e9ea634c 100644 --- a/tests/test_directive_only.py +++ b/tests/test_directive_only.py @@ -1,12 +1,4 @@ -""" - test_only_directive - ~~~~~~~~~~~~~~~~~~~ - - Test the only directive with the test root. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the only directive with the test root.""" import re diff --git a/tests/test_directive_other.py b/tests/test_directive_other.py index e1858f4e0..f221db075 100644 --- a/tests/test_directive_other.py +++ b/tests/test_directive_other.py @@ -1,12 +1,4 @@ -""" - test_directive_other - ~~~~~~~~~~~~~~~~~~~~ - - Test the other directives. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the other directives.""" import pytest from docutils import nodes diff --git a/tests/test_directive_patch.py b/tests/test_directive_patch.py index a199a89db..f4eb8f9db 100644 --- a/tests/test_directive_patch.py +++ b/tests/test_directive_patch.py @@ -1,12 +1,4 @@ -""" - test_directive_patch - ~~~~~~~~~~~~~~~~~~~ - - Test the patched directives. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the patched directives.""" import pytest from docutils import nodes diff --git a/tests/test_docutilsconf.py b/tests/test_docutilsconf.py index 7e47c9ab3..def6cb67d 100644 --- a/tests/test_docutilsconf.py +++ b/tests/test_docutilsconf.py @@ -1,12 +1,4 @@ -""" - test_docutilsconf - ~~~~~~~~~~~~~~~~~ - - Test docutils.conf support for several writers. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test docutils.conf support for several writers.""" import pytest from docutils import nodes diff --git a/tests/test_domain_c.py b/tests/test_domain_c.py index f69008b8f..16a71d9fe 100644 --- a/tests/test_domain_c.py +++ b/tests/test_domain_c.py @@ -1,12 +1,4 @@ -""" - test_domain_c - ~~~~~~~~~~~~~ - - Tests the C Domain - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests the C Domain""" import itertools import zlib diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py index 8fc974f49..72ffc474d 100644 --- a/tests/test_domain_cpp.py +++ b/tests/test_domain_cpp.py @@ -1,12 +1,4 @@ -""" - test_domain_cpp - ~~~~~~~~~~~~~~~ - - Tests the C++ Domain - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests the C++ Domain""" import itertools import re @@ -996,6 +988,11 @@ def test_domain_cpp_ast_attributes(): # position: parameters and qualifiers check('function', 'void f() [[attr1]] [[attr2]]', {1: 'f', 2: '1fv'}) + # position: class, union, enum + check('class', '{key}[[nodiscard]] Foo', {1: 'Foo', 2: '3Foo'}, key='class') + check('union', '{key}[[nodiscard]] Foo', {1: None, 2: '3Foo'}, key='union') + check('enum', '{key}[[nodiscard]] Foo', {1: None, 2: '3Foo'}, key='enum') + def test_domain_cpp_ast_xref_parsing(): def check(target): diff --git a/tests/test_domain_js.py b/tests/test_domain_js.py index b109fe4d8..465fef328 100644 --- a/tests/test_domain_js.py +++ b/tests/test_domain_js.py @@ -1,12 +1,4 @@ -""" - test_domain_js - ~~~~~~~~~~~~~~ - - Tests the JavaScript Domain - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests the JavaScript Domain""" from unittest.mock import Mock diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py index de544d25d..4205ada13 100644 --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -1,12 +1,4 @@ -""" - test_domain_py - ~~~~~~~~~~~~~~ - - Tests the Python Domain - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests the Python Domain""" import re import sys diff --git a/tests/test_domain_rst.py b/tests/test_domain_rst.py index b79431d49..df19ffdb2 100644 --- a/tests/test_domain_rst.py +++ b/tests/test_domain_rst.py @@ -1,12 +1,4 @@ -""" - test_rst_domain - ~~~~~~~~~~~~~~~ - - Tests the reStructuredText domain. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests the reStructuredText domain.""" from sphinx import addnodes from sphinx.addnodes import (desc, desc_addname, desc_annotation, desc_content, desc_name, diff --git a/tests/test_domain_std.py b/tests/test_domain_std.py index 00e7361a3..e92030517 100644 --- a/tests/test_domain_std.py +++ b/tests/test_domain_std.py @@ -1,12 +1,4 @@ -""" - test_domain_std - ~~~~~~~~~~~~~~~ - - Tests the std domain - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests the std domain""" from unittest import mock diff --git a/tests/test_environment.py b/tests/test_environment.py index d8eec2c05..7ffca7898 100644 --- a/tests/test_environment.py +++ b/tests/test_environment.py @@ -1,12 +1,4 @@ -""" - test_env - ~~~~~~~~ - - Test the BuildEnvironment class. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the BuildEnvironment class.""" import os import shutil diff --git a/tests/test_environment_indexentries.py b/tests/test_environment_indexentries.py index f32592f9f..5b7678499 100644 --- a/tests/test_environment_indexentries.py +++ b/tests/test_environment_indexentries.py @@ -1,12 +1,4 @@ -""" - test_environment_indexentries - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test the sphinx.environment.managers.indexentries. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the sphinx.environment.managers.indexentries.""" import pytest diff --git a/tests/test_environment_toctree.py b/tests/test_environment_toctree.py index dc5a184a4..588bcac18 100644 --- a/tests/test_environment_toctree.py +++ b/tests/test_environment_toctree.py @@ -1,12 +1,4 @@ -""" - test_environment_toctree - ~~~~~~~~~~~~~~~~~~~~~~~~ - - Test the sphinx.environment.managers.toctree. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the sphinx.environment.managers.toctree.""" import pytest from docutils import nodes diff --git a/tests/test_events.py b/tests/test_events.py index 44b0526d1..f36c86a87 100644 --- a/tests/test_events.py +++ b/tests/test_events.py @@ -1,12 +1,4 @@ -""" - test_events - ~~~~~~~~~~~ - - Test the EventManager class. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the EventManager class.""" import pytest diff --git a/tests/test_ext_apidoc.py b/tests/test_ext_apidoc.py index 44c3308fe..7aba847a3 100644 --- a/tests/test_ext_apidoc.py +++ b/tests/test_ext_apidoc.py @@ -1,12 +1,4 @@ -""" - test_apidoc - ~~~~~~~~~~~ - - Test the sphinx.apidoc module. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the sphinx.apidoc module.""" from collections import namedtuple diff --git a/tests/test_ext_autodoc.py b/tests/test_ext_autodoc.py index 35a507f77..1f1c7e9e7 100644 --- a/tests/test_ext_autodoc.py +++ b/tests/test_ext_autodoc.py @@ -1,12 +1,7 @@ -""" - test_ext_autodoc - ~~~~~~~~~~~~~~~~ - - Test the autodoc extension. This tests mainly the Documenters; the auto - directives are tested in a test source file translated by test_build. +"""Test the autodoc extension. - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. +This tests mainly the Documenters; the auto directives are tested in a test +source file translated by test_build. """ import sys diff --git a/tests/test_ext_autodoc_autoattribute.py b/tests/test_ext_autodoc_autoattribute.py index fcc1cc8aa..c068da1e4 100644 --- a/tests/test_ext_autodoc_autoattribute.py +++ b/tests/test_ext_autodoc_autoattribute.py @@ -1,12 +1,7 @@ -""" - test_ext_autodoc_autoattribute - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test the autodoc extension. This tests mainly the Documenters; the auto - directives are tested in a test source file translated by test_build. +"""Test the autodoc extension. - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. +This tests mainly the Documenters; the auto directives are tested in a test +source file translated by test_build. """ import sys diff --git a/tests/test_ext_autodoc_autoclass.py b/tests/test_ext_autodoc_autoclass.py index 585dcaae1..02e6d4990 100644 --- a/tests/test_ext_autodoc_autoclass.py +++ b/tests/test_ext_autodoc_autoclass.py @@ -1,12 +1,7 @@ -""" - test_ext_autodoc_autoclass - ~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test the autodoc extension. This tests mainly the Documenters; the auto - directives are tested in a test source file translated by test_build. +"""Test the autodoc extension. - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. +This tests mainly the Documenters; the auto directives are tested in a test +source file translated by test_build. """ import sys diff --git a/tests/test_ext_autodoc_autodata.py b/tests/test_ext_autodoc_autodata.py index 169acbd11..6ebf92c56 100644 --- a/tests/test_ext_autodoc_autodata.py +++ b/tests/test_ext_autodoc_autodata.py @@ -1,12 +1,7 @@ -""" - test_ext_autodoc_autodata - ~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test the autodoc extension. This tests mainly the Documenters; the auto - directives are tested in a test source file translated by test_build. +"""Test the autodoc extension. - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. +This tests mainly the Documenters; the auto directives are tested in a test +source file translated by test_build. """ import sys diff --git a/tests/test_ext_autodoc_autofunction.py b/tests/test_ext_autodoc_autofunction.py index c97be35c9..dc6a52672 100644 --- a/tests/test_ext_autodoc_autofunction.py +++ b/tests/test_ext_autodoc_autofunction.py @@ -1,12 +1,7 @@ -""" - test_ext_autodoc_autofunction - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test the autodoc extension. This tests mainly the Documenters; the auto - directives are tested in a test source file translated by test_build. +"""Test the autodoc extension. - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. +This tests mainly the Documenters; the auto directives are tested in a test +source file translated by test_build. """ import pytest diff --git a/tests/test_ext_autodoc_automodule.py b/tests/test_ext_autodoc_automodule.py index f3377f6e6..06a4ab276 100644 --- a/tests/test_ext_autodoc_automodule.py +++ b/tests/test_ext_autodoc_automodule.py @@ -1,12 +1,7 @@ -""" - test_ext_autodoc_autocmodule - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test the autodoc extension. This tests mainly the Documenters; the auto - directives are tested in a test source file translated by test_build. +"""Test the autodoc extension. - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. +This tests mainly the Documenters; the auto directives are tested in a test +source file translated by test_build. """ import sys diff --git a/tests/test_ext_autodoc_autoproperty.py b/tests/test_ext_autodoc_autoproperty.py index 4b62165e3..3d50020b3 100644 --- a/tests/test_ext_autodoc_autoproperty.py +++ b/tests/test_ext_autodoc_autoproperty.py @@ -1,12 +1,7 @@ -""" - test_ext_autodoc_autoproperty - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test the autodoc extension. This tests mainly the Documenters; the auto - directives are tested in a test source file translated by test_build. +"""Test the autodoc extension. - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. +This tests mainly the Documenters; the auto directives are tested in a test +source file translated by test_build. """ import sys diff --git a/tests/test_ext_autodoc_configs.py b/tests/test_ext_autodoc_configs.py index efe14fe31..70515bca1 100644 --- a/tests/test_ext_autodoc_configs.py +++ b/tests/test_ext_autodoc_configs.py @@ -1,12 +1,4 @@ -""" - test_ext_autodoc_configs - ~~~~~~~~~~~~~~~~~~~~~~~~ - - Test the autodoc extension. This tests mainly for config variables - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the autodoc extension. This tests mainly for config variables""" import platform import sys diff --git a/tests/test_ext_autodoc_events.py b/tests/test_ext_autodoc_events.py index 6a71054c2..91e1d27d2 100644 --- a/tests/test_ext_autodoc_events.py +++ b/tests/test_ext_autodoc_events.py @@ -1,12 +1,4 @@ -""" - test_ext_autodoc_events - ~~~~~~~~~~~~~~~~~~~~~~~ - - Test the autodoc extension. This tests mainly for autodoc events - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the autodoc extension. This tests mainly for autodoc events""" import pytest diff --git a/tests/test_ext_autodoc_mock.py b/tests/test_ext_autodoc_mock.py index c207c82fc..0f3288c28 100644 --- a/tests/test_ext_autodoc_mock.py +++ b/tests/test_ext_autodoc_mock.py @@ -1,12 +1,4 @@ -""" - test_ext_autodoc_mock - ~~~~~~~~~~~~~~~~~~~~~ - - Test the autodoc extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the autodoc extension.""" import abc import sys diff --git a/tests/test_ext_autodoc_preserve_defaults.py b/tests/test_ext_autodoc_preserve_defaults.py index 411cbf6bf..16650b2c7 100644 --- a/tests/test_ext_autodoc_preserve_defaults.py +++ b/tests/test_ext_autodoc_preserve_defaults.py @@ -1,12 +1,4 @@ -""" - test_ext_autodoc_preserve_defaults - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test the autodoc extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the autodoc extension.""" import sys diff --git a/tests/test_ext_autodoc_private_members.py b/tests/test_ext_autodoc_private_members.py index f685f774c..bdb947821 100644 --- a/tests/test_ext_autodoc_private_members.py +++ b/tests/test_ext_autodoc_private_members.py @@ -1,11 +1,4 @@ -""" - test_ext_autodoc_private_members - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test the autodoc extension. This tests mainly for private-members option. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. +"""Test the autodoc extension. This tests mainly for private-members option. """ import pytest diff --git a/tests/test_ext_autosectionlabel.py b/tests/test_ext_autosectionlabel.py index ccbc9ed77..7345ca3ff 100644 --- a/tests/test_ext_autosectionlabel.py +++ b/tests/test_ext_autosectionlabel.py @@ -1,12 +1,4 @@ -""" - test_ext_autosectionlabel - ~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test sphinx.ext.autosectionlabel extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.ext.autosectionlabel extension.""" import re diff --git a/tests/test_ext_autosummary.py b/tests/test_ext_autosummary.py index 13da15e50..fd77db816 100644 --- a/tests/test_ext_autosummary.py +++ b/tests/test_ext_autosummary.py @@ -1,12 +1,4 @@ -""" - test_autosummary - ~~~~~~~~~~~~~~~~ - - Test the autosummary extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the autosummary extension.""" import sys from io import StringIO diff --git a/tests/test_ext_coverage.py b/tests/test_ext_coverage.py index 6d6fbcf1d..ee179a86b 100644 --- a/tests/test_ext_coverage.py +++ b/tests/test_ext_coverage.py @@ -1,12 +1,4 @@ -""" - test_coverage - ~~~~~~~~~~~~~ - - Test the coverage builder. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the coverage builder.""" import pickle diff --git a/tests/test_ext_doctest.py b/tests/test_ext_doctest.py index 3a527acb2..6e8a4123e 100644 --- a/tests/test_ext_doctest.py +++ b/tests/test_ext_doctest.py @@ -1,12 +1,4 @@ -""" - test_doctest - ~~~~~~~~~~~~ - - Test the doctest extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the doctest extension.""" import os from collections import Counter diff --git a/tests/test_ext_duration.py b/tests/test_ext_duration.py index b16cbc4f4..4fa4dfc30 100644 --- a/tests/test_ext_duration.py +++ b/tests/test_ext_duration.py @@ -1,12 +1,4 @@ -""" - test_ext_duration - ~~~~~~~~~~~~~~~~~ - - Test sphinx.ext.duration extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.ext.duration extension.""" import re diff --git a/tests/test_ext_githubpages.py b/tests/test_ext_githubpages.py index 9d87b0212..445719e12 100644 --- a/tests/test_ext_githubpages.py +++ b/tests/test_ext_githubpages.py @@ -1,12 +1,4 @@ -""" - test_ext_githubpages - ~~~~~~~~~~~~~~~~~~~~ - - Test sphinx.ext.githubpages extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.ext.githubpages extension.""" import pytest diff --git a/tests/test_ext_graphviz.py b/tests/test_ext_graphviz.py index 15eaf6050..7ffe7ead2 100644 --- a/tests/test_ext_graphviz.py +++ b/tests/test_ext_graphviz.py @@ -1,12 +1,4 @@ -""" - test_ext_graphviz - ~~~~~~~~~~~~~~~~~ - - Test sphinx.ext.graphviz extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.ext.graphviz extension.""" import re diff --git a/tests/test_ext_ifconfig.py b/tests/test_ext_ifconfig.py index f8f897149..3c4651b3f 100644 --- a/tests/test_ext_ifconfig.py +++ b/tests/test_ext_ifconfig.py @@ -1,12 +1,4 @@ -""" - test_ext_ifconfig - ~~~~~~~~~~~~~~~~~ - - Test sphinx.ext.ifconfig extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.ext.ifconfig extension.""" import pytest diff --git a/tests/test_ext_imgconverter.py b/tests/test_ext_imgconverter.py index b4dbf125b..134947c87 100644 --- a/tests/test_ext_imgconverter.py +++ b/tests/test_ext_imgconverter.py @@ -1,12 +1,4 @@ -""" - test_ext_imgconverter - ~~~~~~~~~~~~~~~~~~~~~ - - Test sphinx.ext.imgconverter extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.ext.imgconverter extension.""" import os diff --git a/tests/test_ext_inheritance_diagram.py b/tests/test_ext_inheritance_diagram.py index bd563b4fc..a6218eccc 100644 --- a/tests/test_ext_inheritance_diagram.py +++ b/tests/test_ext_inheritance_diagram.py @@ -1,12 +1,4 @@ -""" - test_ext_inheritance_diagram - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Test sphinx.ext.inheritance_diagram extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.ext.inheritance_diagram extension.""" import os import re diff --git a/tests/test_ext_intersphinx.py b/tests/test_ext_intersphinx.py index b2ad8afe5..7d52ff95e 100644 --- a/tests/test_ext_intersphinx.py +++ b/tests/test_ext_intersphinx.py @@ -1,12 +1,4 @@ -""" - test_intersphinx - ~~~~~~~~~~~~~~~~ - - Test the intersphinx extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the intersphinx extension.""" import http.server import os diff --git a/tests/test_ext_math.py b/tests/test_ext_math.py index 5dd713961..e3345e627 100644 --- a/tests/test_ext_math.py +++ b/tests/test_ext_math.py @@ -1,12 +1,4 @@ -""" - test_ext_math - ~~~~~~~~~~~~~ - - Test math extensions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test math extensions.""" import re import subprocess diff --git a/tests/test_ext_napoleon.py b/tests/test_ext_napoleon.py index 250fdae26..a1b98996f 100644 --- a/tests/test_ext_napoleon.py +++ b/tests/test_ext_napoleon.py @@ -1,13 +1,4 @@ -""" - test_napoleon - ~~~~~~~~~~~~~ - - Tests for :mod:`sphinx.ext.napoleon.__init__` module. - - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests for :mod:`sphinx.ext.napoleon.__init__` module.""" import sys from collections import namedtuple diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py index 21278dbca..ed97b6351 100644 --- a/tests/test_ext_napoleon_docstring.py +++ b/tests/test_ext_napoleon_docstring.py @@ -1,13 +1,4 @@ -""" - test_napoleon_docstring - ~~~~~~~~~~~~~~~~~~~~~~~ - - Tests for :mod:`sphinx.ext.napoleon.docstring` module. - - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests for :mod:`sphinx.ext.napoleon.docstring` module.""" import re import sys diff --git a/tests/test_ext_napoleon_iterators.py b/tests/test_ext_napoleon_iterators.py index 95c2778e8..6b80af6bf 100644 --- a/tests/test_ext_napoleon_iterators.py +++ b/tests/test_ext_napoleon_iterators.py @@ -1,13 +1,4 @@ -""" - test_napoleon_iterators - ~~~~~~~~~~~~~~~~~~~~~~~ - - Tests for :mod:`sphinx.ext.napoleon.iterators` module. - - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests for :mod:`sphinx.ext.napoleon.iterators` module.""" from unittest import TestCase diff --git a/tests/test_ext_todo.py b/tests/test_ext_todo.py index 3bc2abadf..ffe8bd995 100644 --- a/tests/test_ext_todo.py +++ b/tests/test_ext_todo.py @@ -1,12 +1,4 @@ -""" - test_ext_todo - ~~~~~~~~~~~~~ - - Test sphinx.ext.todo extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.ext.todo extension.""" import re diff --git a/tests/test_ext_viewcode.py b/tests/test_ext_viewcode.py index 140b2a728..c2e195428 100644 --- a/tests/test_ext_viewcode.py +++ b/tests/test_ext_viewcode.py @@ -1,12 +1,4 @@ -""" - test_ext_viewcode - ~~~~~~~~~~~~~~~~~ - - Test sphinx.ext.viewcode extension. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.ext.viewcode extension.""" import re diff --git a/tests/test_extension.py b/tests/test_extension.py index 4e7fffffa..d74743cca 100644 --- a/tests/test_extension.py +++ b/tests/test_extension.py @@ -1,12 +1,4 @@ -""" - test_extension - ~~~~~~~~~~~~~~ - - Test sphinx.extension module. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.extension module.""" import pytest diff --git a/tests/test_highlighting.py b/tests/test_highlighting.py index d83f2f1cc..92276a21c 100644 --- a/tests/test_highlighting.py +++ b/tests/test_highlighting.py @@ -1,12 +1,4 @@ -""" - test_highlighting - ~~~~~~~~~~~~~~~~~ - - Test the Pygments highlighting bridge. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the Pygments highlighting bridge.""" from unittest import mock diff --git a/tests/test_intl.py b/tests/test_intl.py index 62dbb1352..44740f67d 100644 --- a/tests/test_intl.py +++ b/tests/test_intl.py @@ -1,12 +1,6 @@ -""" - test_intl - ~~~~~~~~~ - - Test message patching for internationalization purposes. Runs the text - builder in the test root. +"""Test message patching for internationalization purposes. - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. +Runs the text builder in the test root. """ import os diff --git a/tests/test_locale.py b/tests/test_locale.py index c5765ccdf..1dcad64eb 100644 --- a/tests/test_locale.py +++ b/tests/test_locale.py @@ -1,12 +1,4 @@ -""" - test_locale - ~~~~~~~~~~ - - Test locale. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test locale.""" import pytest diff --git a/tests/test_markup.py b/tests/test_markup.py index dbd0f0272..6ec592073 100644 --- a/tests/test_markup.py +++ b/tests/test_markup.py @@ -1,12 +1,4 @@ -""" - test_markup - ~~~~~~~~~~~ - - Test various Sphinx-specific markup extensions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test various Sphinx-specific markup extensions.""" import re @@ -158,10 +150,10 @@ def get_verifier(verify, verify_re): ':pep:`8`', # since docutils-0.19, :pep: role points to python.org via https schema ('<p><span class="target" id="index-0"></span><a class="pep reference external" ' - 'href="https?://www.python.org/dev/peps/pep-0008"><strong>PEP 8</strong></a></p>'), + 'href="https?://(www.python.org/dev/peps|peps.python.org)/pep-0008"><strong>PEP 8</strong></a></p>'), (r'\\sphinxAtStartPar\n' r'\\index{Python Enhancement Proposals@\\spxentry{Python Enhancement Proposals}' - r'!PEP 8@\\spxentry{PEP 8}}\\sphinxhref{https?://www.python.org/dev/peps/pep-0008}' + r'!PEP 8@\\spxentry{PEP 8}}\\sphinxhref{https?://(www.python.org/dev/peps|peps.python.org)/pep-0008}' r'{\\sphinxstylestrong{PEP 8}}') ), ( @@ -170,12 +162,12 @@ def get_verifier(verify, verify_re): ':pep:`8#id1`', # since docutils-0.19, :pep: role points to python.org via https schema ('<p><span class="target" id="index-0"></span><a class="pep reference external" ' - 'href="https?://www.python.org/dev/peps/pep-0008#id1">' + 'href="https?://(www.python.org/dev/peps|peps.python.org)/pep-0008#id1">' '<strong>PEP 8#id1</strong></a></p>'), (r'\\sphinxAtStartPar\n' r'\\index{Python Enhancement Proposals@\\spxentry{Python Enhancement Proposals}' r'!PEP 8\\#id1@\\spxentry{PEP 8\\#id1}}\\sphinxhref' - r'{https?://www.python.org/dev/peps/pep-0008\\#id1}' + r'{https?://(www.python.org/dev/peps|peps.python.org)/pep-0008\\#id1}' r'{\\sphinxstylestrong{PEP 8\\#id1}}') ), ( diff --git a/tests/test_metadata.py b/tests/test_metadata.py index a2e26a42b..7f3199705 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -1,12 +1,4 @@ -""" - test_metadata - ~~~~~~~~~~~~~ - - Test our handling of metadata in files with bibliographic metadata. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test our handling of metadata in files with bibliographic metadata.""" # adapted from an example of bibliographic metadata at # https://docutils.sourceforge.io/docs/user/rst/demo.txt diff --git a/tests/test_parser.py b/tests/test_parser.py index cbe9a61df..86163c6ad 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -1,12 +1,4 @@ -""" - test_sphinx_parsers - ~~~~~~~~~~~~~~~~~~~ - - Tests parsers module. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests parsers module.""" from unittest.mock import Mock, patch diff --git a/tests/test_project.py b/tests/test_project.py index dc7f1d35d..40db85ef3 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -1,12 +1,4 @@ -""" - test_project - ~~~~~~~~~~~~ - - Tests project module. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests project module.""" from collections import OrderedDict diff --git a/tests/test_pycode.py b/tests/test_pycode.py index 312c0245d..1f9882eb9 100644 --- a/tests/test_pycode.py +++ b/tests/test_pycode.py @@ -1,12 +1,4 @@ -""" - test_pycode - ~~~~~~~~~~~ - - Test pycode. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test pycode.""" import os import sys diff --git a/tests/test_pycode_ast.py b/tests/test_pycode_ast.py index 0de03d5ea..6143105eb 100644 --- a/tests/test_pycode_ast.py +++ b/tests/test_pycode_ast.py @@ -1,12 +1,4 @@ -""" - test_pycode_ast - ~~~~~~~~~~~~~~~ - - Test pycode.ast - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test pycode.ast""" import sys diff --git a/tests/test_pycode_parser.py b/tests/test_pycode_parser.py index 11e47a86b..5d2496ba5 100644 --- a/tests/test_pycode_parser.py +++ b/tests/test_pycode_parser.py @@ -1,12 +1,4 @@ -""" - test_pycode_parser - ~~~~~~~~~~~~~~~~~~ - - Test pycode.parser. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test pycode.parser.""" from sphinx.pycode.parser import Parser from sphinx.util.inspect import signature_from_str diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py index 0f317c5a8..1ea85b19b 100644 --- a/tests/test_quickstart.py +++ b/tests/test_quickstart.py @@ -1,12 +1,4 @@ -""" - test_quickstart - ~~~~~~~~~~~~~~~ - - Test the sphinx.quickstart module. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the sphinx.quickstart module.""" import time from io import StringIO diff --git a/tests/test_roles.py b/tests/test_roles.py index a7e936376..67a13c8ef 100644 --- a/tests/test_roles.py +++ b/tests/test_roles.py @@ -1,12 +1,4 @@ -""" - test_roles - ~~~~~~~~~~ - - Test sphinx.roles - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.roles""" from unittest.mock import Mock diff --git a/tests/test_search.py b/tests/test_search.py index 4c74ac24a..024e6941c 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -1,12 +1,4 @@ -""" - test_search - ~~~~~~~~~~~ - - Test the search index builder. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the search index builder.""" from collections import namedtuple from io import BytesIO diff --git a/tests/test_setup_command.py b/tests/test_setup_command.py index 0a1176ae6..054912feb 100644 --- a/tests/test_setup_command.py +++ b/tests/test_setup_command.py @@ -1,12 +1,4 @@ -""" - test_setup_command - ~~~~~~~~~~~~~~~~~~~ - - Test setup_command for distutils. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test setup_command for distutils.""" import os import subprocess diff --git a/tests/test_smartquotes.py b/tests/test_smartquotes.py index bd8216167..6cfb716e4 100644 --- a/tests/test_smartquotes.py +++ b/tests/test_smartquotes.py @@ -1,12 +1,4 @@ -""" - test_smartquotes - ~~~~~~~~~~~~~~~~ - - Test smart quotes. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test smart quotes.""" import pytest from html5lib import HTMLParser diff --git a/tests/test_templating.py b/tests/test_templating.py index 37e280c3b..7a6f1f004 100644 --- a/tests/test_templating.py +++ b/tests/test_templating.py @@ -1,12 +1,4 @@ -""" - test_templating - ~~~~~~~~~~~~~~~~ - - Test templating. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test templating.""" import pytest diff --git a/tests/test_theming.py b/tests/test_theming.py index 60dd72cdf..21382d84b 100644 --- a/tests/test_theming.py +++ b/tests/test_theming.py @@ -1,12 +1,4 @@ -""" - test_theming - ~~~~~~~~~~~~ - - Test the Theme class. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the Theme class.""" import os diff --git a/tests/test_toctree.py b/tests/test_toctree.py index 33e73c98c..e1afa4bb9 100644 --- a/tests/test_toctree.py +++ b/tests/test_toctree.py @@ -1,12 +1,4 @@ -""" - test_toctree - ~~~~~~~~~~~~ - - Test the HTML builder and check output against XPath. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the HTML builder and check output against XPath.""" import re import pytest diff --git a/tests/test_transforms_post_transforms.py b/tests/test_transforms_post_transforms.py index fe0a7b06b..e5ec8ad14 100644 --- a/tests/test_transforms_post_transforms.py +++ b/tests/test_transforms_post_transforms.py @@ -1,12 +1,4 @@ -""" - test_transforms_post_transforms - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Tests the post_transforms - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests the post_transforms""" import pytest from docutils import nodes diff --git a/tests/test_transforms_post_transforms_code.py b/tests/test_transforms_post_transforms_code.py index 11369d2ba..2715eb5a5 100644 --- a/tests/test_transforms_post_transforms_code.py +++ b/tests/test_transforms_post_transforms_code.py @@ -1,11 +1,3 @@ -""" - test_transforms_post_transforms_code - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" - import pytest diff --git a/tests/test_util.py b/tests/test_util.py index 0023bbcdb..e93e6586c 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,12 +1,4 @@ -""" - test_util - ~~~~~~~~~~~~~~~ - - Tests util functions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests util functions.""" import os import tempfile diff --git a/tests/test_util_docstrings.py b/tests/test_util_docstrings.py index 73f155cf3..813e84e97 100644 --- a/tests/test_util_docstrings.py +++ b/tests/test_util_docstrings.py @@ -1,12 +1,4 @@ -""" - test_util_docstrings - ~~~~~~~~~~~~~~~~~~~~ - - Test sphinx.util.docstrings. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test sphinx.util.docstrings.""" from sphinx.util.docstrings import prepare_commentdoc, prepare_docstring, separate_metadata diff --git a/tests/test_util_docutils.py b/tests/test_util_docutils.py index 9a7a05e49..41022dd99 100644 --- a/tests/test_util_docutils.py +++ b/tests/test_util_docutils.py @@ -1,12 +1,4 @@ -""" - test_util_docutils - ~~~~~~~~~~~~~~~~~~ - - Tests util.utils functions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests util.utils functions.""" import os diff --git a/tests/test_util_fileutil.py b/tests/test_util_fileutil.py index 4d6edd0ce..27f95e644 100644 --- a/tests/test_util_fileutil.py +++ b/tests/test_util_fileutil.py @@ -1,12 +1,4 @@ -""" - test_util_fileutil - ~~~~~~~~~~~~~~~~~~ - - Tests sphinx.util.fileutil functions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests sphinx.util.fileutil functions.""" from unittest import mock diff --git a/tests/test_util_i18n.py b/tests/test_util_i18n.py index 49a7067f5..d962fa2df 100644 --- a/tests/test_util_i18n.py +++ b/tests/test_util_i18n.py @@ -1,12 +1,4 @@ -""" - test_util_i18n - ~~~~~~~~~~~~~~ - - Test i18n util. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test i18n util.""" import datetime import os diff --git a/tests/test_util_images.py b/tests/test_util_images.py index e2c0c61f0..52fb5e990 100644 --- a/tests/test_util_images.py +++ b/tests/test_util_images.py @@ -1,12 +1,4 @@ -""" - test_util_images - ~~~~~~~~~~~~~~~~ - - Test images util. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test images util.""" import pytest diff --git a/tests/test_util_inspect.py b/tests/test_util_inspect.py index 589d522f3..5840e9d1e 100644 --- a/tests/test_util_inspect.py +++ b/tests/test_util_inspect.py @@ -1,12 +1,4 @@ -""" - test_util_inspect - ~~~~~~~~~~~~~~~ - - Tests util.inspect functions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests util.inspect functions.""" import ast import datetime diff --git a/tests/test_util_inventory.py b/tests/test_util_inventory.py index 305ef4353..e79602330 100644 --- a/tests/test_util_inventory.py +++ b/tests/test_util_inventory.py @@ -1,12 +1,4 @@ -""" - test_util_inventory - ~~~~~~~~~~~~~~~~~~~ - - Test inventory util functions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test inventory util functions.""" import posixpath import zlib diff --git a/tests/test_util_logging.py b/tests/test_util_logging.py index 3c78368d1..49cd2c11e 100644 --- a/tests/test_util_logging.py +++ b/tests/test_util_logging.py @@ -1,12 +1,4 @@ -""" - test_util_logging - ~~~~~~~~~~~~~~~~~ - - Test logging util. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test logging util.""" import codecs import os diff --git a/tests/test_util_matching.py b/tests/test_util_matching.py index 651546c92..ee1d3b2cb 100644 --- a/tests/test_util_matching.py +++ b/tests/test_util_matching.py @@ -1,12 +1,4 @@ -""" - test_util_matching - ~~~~~~~~~~~~~~~~~~ - - Tests sphinx.util.matching functions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests sphinx.util.matching functions.""" from sphinx.util.matching import Matcher, compile_matchers diff --git a/tests/test_util_nodes.py b/tests/test_util_nodes.py index fe0a278e6..031569d4c 100644 --- a/tests/test_util_nodes.py +++ b/tests/test_util_nodes.py @@ -1,12 +1,4 @@ -""" - test_util_nodes - ~~~~~~~~~~~~~~~ - - Tests uti.nodes functions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests uti.nodes functions.""" from textwrap import dedent from typing import Any diff --git a/tests/test_util_rst.py b/tests/test_util_rst.py index da3dba707..40a2ee68b 100644 --- a/tests/test_util_rst.py +++ b/tests/test_util_rst.py @@ -1,12 +1,4 @@ -""" - test_util_rst - ~~~~~~~~~~~~~~~ - - Tests sphinx.util.rst functions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests sphinx.util.rst functions.""" from docutils.statemachine import StringList from jinja2 import Environment diff --git a/tests/test_util_template.py b/tests/test_util_template.py index 36f1dac35..4601179c1 100644 --- a/tests/test_util_template.py +++ b/tests/test_util_template.py @@ -1,12 +1,4 @@ -""" - test_util_template - ~~~~~~~~~~~~~~~~~~ - - Tests sphinx.util.template functions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests sphinx.util.template functions.""" from sphinx.util.template import ReSTRenderer diff --git a/tests/test_util_typing.py b/tests/test_util_typing.py index 7d81fee5d..5aa558c82 100644 --- a/tests/test_util_typing.py +++ b/tests/test_util_typing.py @@ -1,12 +1,4 @@ -""" - test_util_typing - ~~~~~~~~~~~~~~~~ - - Tests util.typing functions. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Tests util.typing functions.""" import sys from numbers import Integral @@ -78,7 +70,12 @@ def test_restify_type_hints_containers(): "[:py:class:`str`, :py:class:`str`, " ":py:class:`str`]") assert restify(Tuple[str, ...]) == ":py:class:`~typing.Tuple`\\ [:py:class:`str`, ...]" - assert restify(Tuple[()]) == ":py:class:`~typing.Tuple`\\ [()]" + + if sys.version_info < (3, 11): + assert restify(Tuple[()]) == ":py:class:`~typing.Tuple`\\ [()]" + else: + assert restify(Tuple[()]) == ":py:class:`~typing.Tuple`" + assert restify(List[Dict[str, Tuple]]) == (":py:class:`~typing.List`\\ " "[:py:class:`~typing.Dict`\\ " "[:py:class:`str`, :py:class:`~typing.Tuple`]]") @@ -271,9 +268,14 @@ def test_stringify_type_hints_containers(): assert stringify(Tuple[str, ...], "fully-qualified") == "typing.Tuple[str, ...]" assert stringify(Tuple[str, ...], "smart") == "~typing.Tuple[str, ...]" - assert stringify(Tuple[()]) == "Tuple[()]" - assert stringify(Tuple[()], "fully-qualified") == "typing.Tuple[()]" - assert stringify(Tuple[()], "smart") == "~typing.Tuple[()]" + if sys.version_info < (3, 11): + assert stringify(Tuple[()]) == "Tuple[()]" + assert stringify(Tuple[()], "fully-qualified") == "typing.Tuple[()]" + assert stringify(Tuple[()], "smart") == "~typing.Tuple[()]" + else: + assert stringify(Tuple[()]) == "Tuple" + assert stringify(Tuple[()], "fully-qualified") == "typing.Tuple" + assert stringify(Tuple[()], "smart") == "~typing.Tuple" assert stringify(List[Dict[str, Tuple]]) == "List[Dict[str, Tuple]]" assert stringify(List[Dict[str, Tuple]], "fully-qualified") == "typing.List[typing.Dict[str, typing.Tuple]]" diff --git a/tests/test_versioning.py b/tests/test_versioning.py index 4de8331aa..107e21560 100644 --- a/tests/test_versioning.py +++ b/tests/test_versioning.py @@ -1,12 +1,4 @@ -""" - test_versioning - ~~~~~~~~~~~~~~~ - - Test the versioning implementation. - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the versioning implementation.""" import pickle diff --git a/tests/test_writer_latex.py b/tests/test_writer_latex.py index ccb578f3e..d51879949 100644 --- a/tests/test_writer_latex.py +++ b/tests/test_writer_latex.py @@ -1,12 +1,4 @@ -""" - test_writer_latex - ~~~~~~~~~~~~~~~~ - - Test the LaTeX writer - - :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -""" +"""Test the LaTeX writer""" import pytest |