Skip to content

Commit e7977a8

Browse files
committed
wip
1 parent 796b27e commit e7977a8

File tree

92 files changed

+175
-410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+175
-410
lines changed

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@ dev-dependencies = [
109109
]
110110

111111
[tool.inline-snapshot]
112-
snapshot-dir = "tests/snapshots"
112+
storage-dir = "tests/snapshots"

tests/snapshots/__init__.py

+166-347
Large diffs are not rendered by default.

tests/snapshots/external/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# ignore all snapshots which are not refered in the source
2+
*-new.*

tests/test_end_to_end.py

+6-62
Original file line numberDiff line numberDiff line change
@@ -17,62 +17,6 @@
1717
from mkdocstrings.handlers.python import PythonHandler
1818

1919

20-
options: dict[str, Any] = {
21-
# General options.
22-
"find_stubs_package": (True, False),
23-
"allow_inspection": (True, False),
24-
"show_bases": (True, False),
25-
"show_source": (True, False),
26-
"preload_modules": ((), ("mod1",), None),
27-
# Heading options.
28-
"heading_level": (1, 2, 3, 4, 5, 6),
29-
"show_root_heading": (True, False),
30-
"show_root_toc_entry": (True, False),
31-
"show_root_full_path": (True, False),
32-
"show_root_members_full_path": (True, False),
33-
"show_object_full_path": (True, False),
34-
"show_category_heading": (True, False),
35-
"show_symbol_type_heading": (True, False),
36-
"show_symbol_type_toc": (True, False),
37-
# Members options.
38-
"inherited_members": ((), ("method1",), True, False),
39-
"members": ((), ("module_attribute",), True, False, None),
40-
"members_order": ("source", "alphabetical"),
41-
"filters": ((), ("!module_attribute",), ("module_attribute",), None),
42-
"group_by_category": (True, False),
43-
"show_submodules": (True, False),
44-
"summary": (True, False), # TODO: Test dict.
45-
"show_labels": (True, False),
46-
# Docstrings options.
47-
"docstring_style": ("numpy", "google", "sphinx", None),
48-
"docstring_options": ({},), # TODO: Add more examples.
49-
"docstring_section_style": ("table", "list", "spacy"),
50-
"merge_init_into_class": (True, False),
51-
"show_if_no_docstring": (True, False),
52-
"show_docstring_attributes": (True, False),
53-
"show_docstring_functions": (True, False),
54-
"show_docstring_classes": (True, False),
55-
"show_docstring_modules": (True, False),
56-
"show_docstring_description": (True, False),
57-
"show_docstring_examples": (True, False),
58-
"show_docstring_other_parameters": (True, False),
59-
"show_docstring_parameters": (True, False),
60-
"show_docstring_raises": (True, False),
61-
"show_docstring_receives": (True, False),
62-
"show_docstring_returns": (True, False),
63-
"show_docstring_warns": (True, False),
64-
"show_docstring_yields": (True, False),
65-
# Signature options.
66-
"annotations_path": ("brief", "source", "full"),
67-
"line_length": (0, 1, 10, 60, 120, 1000),
68-
"show_signature": (True, False),
69-
"show_signature_annotations": (True, False),
70-
"signature_crossrefs": (True, False),
71-
"separate_signature": (True, False),
72-
"unwrap_annotated": (True, False),
73-
}
74-
75-
7620
def _normalize_html(html: str) -> str:
7721
soup = bs4.BeautifulSoup(html, features="html.parser")
7822
html = soup.prettify()
@@ -105,9 +49,9 @@ def _render_options(options: dict[str, Any]) -> str:
10549

10650

10751
# Signature options
108-
@pytest.mark.parametrize("show_signature_annotations", options["show_signature_annotations"])
109-
@pytest.mark.parametrize("signature_crossrefs", options["signature_crossrefs"])
110-
@pytest.mark.parametrize("separate_signature", options["separate_signature"])
52+
@pytest.mark.parametrize("show_signature_annotations", [True, False])
53+
@pytest.mark.parametrize("signature_crossrefs", [True, False])
54+
@pytest.mark.parametrize("separate_signature", [True, False])
11155
def test_end_to_end_for_signatures(
11256
session_handler: PythonHandler,
11357
show_signature_annotations: bool,
@@ -144,9 +88,9 @@ def method1(self, a: int, b: str) -> None:
14488

14589

14690
# Members options.
147-
@pytest.mark.parametrize("inherited_members", options["inherited_members"])
148-
@pytest.mark.parametrize("members", options["members"])
149-
@pytest.mark.parametrize("filters", options["filters"])
91+
@pytest.mark.parametrize("inherited_members", [(), ("method1",), True, False])
92+
@pytest.mark.parametrize("members", [(), ("module_attribute",), True, False, None])
93+
@pytest.mark.parametrize("filters", [(), ("!module_attribute",), ("module_attribute",), None])
15094
def test_end_to_end_for_members(
15195
session_handler: PythonHandler,
15296
inherited_members: list[str] | bool | None,

0 commit comments

Comments
 (0)