Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 9, 2024
1 parent 4c772ac commit 0a2638c
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,11 +1267,11 @@ def typehints_use_signature(a: AsyncGenerator) -> AsyncGenerator:
"""
return a


prolog = """
.. |test_node_start| replace:: {test_node_start}
""".format(
test_node_start="test_start"
)
""".format(test_node_start="test_start")


@expected(
"""
Expand All @@ -1290,9 +1290,8 @@ def typehints_use_signature(a: AsyncGenerator) -> AsyncGenerator:
Some notes. test_start More notes
""",
rst_prolog=prolog
rst_prolog=prolog,
)

def docstring_with_multiline_note_after_params_prolog_replace(param: int) -> None: # noqa: ARG001
"""Do something.
Expand All @@ -1305,11 +1304,12 @@ def docstring_with_multiline_note_after_params_prolog_replace(param: int) -> Non
More notes
"""


epilog = """
.. |test_node_end| replace:: {test_node_end}
""".format(
test_node_end="test_end"
)
""".format(test_node_end="test_end")


@expected(
"""
mod.docstring_with_multiline_note_after_params_epilog_replace(param)
Expand All @@ -1327,9 +1327,8 @@ def docstring_with_multiline_note_after_params_prolog_replace(param: int) -> Non
Some notes. test_end More notes
""",
rst_epilog=epilog
rst_epilog=epilog,
)

def docstring_with_multiline_note_after_params_epilog_replace(param: int) -> None: # noqa: ARG001
"""Do something.
Expand All @@ -1342,33 +1341,27 @@ def docstring_with_multiline_note_after_params_epilog_replace(param: int) -> Non
More notes
"""


# Config settings for each test run.
# Config Name: Sphinx Options as Dict.
configs = {
"default_conf": {},
"prolog_conf": {
"rst_prolog": prolog
},
"prolog_conf": {"rst_prolog": prolog},
"epilog_conf": {
"rst_epilog": epilog,
},
"bothlog_conf": {
"rst_prolog": prolog,
"rst_epilog": epilog,
}
},
}


@pytest.mark.parametrize("val", [x for x in globals().values() if hasattr(x, "EXPECTED")])
@pytest.mark.parametrize("conf_run", ["default_conf", "prolog_conf", "epilog_conf", "bothlog_conf"])
@pytest.mark.sphinx("text", testroot="integration")
def test_integration(
app: SphinxTestApp,
status: StringIO,
warning: StringIO,
monkeypatch: pytest.MonkeyPatch,
val: Any,
conf_run: str
app: SphinxTestApp, status: StringIO, warning: StringIO, monkeypatch: pytest.MonkeyPatch, val: Any, conf_run: str
) -> None:
if isclass(val) and issubclass(val, BaseException):
template = AUTO_EXCEPTION
Expand Down

0 comments on commit 0a2638c

Please sign in to comment.