diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index 61bc295..d54d8cd 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -1,7 +1,7 @@ - +# this package from attr_utils.annotations import AttrsClass from attr_utils.autoattrs import AttrsDocumenter def test_can_document(): - assert AttrsDocumenter.can_document_member(AttrsClass, None, None, None) + assert AttrsDocumenter.can_document_member(AttrsClass, "AttrsClass", False, None) diff --git a/tests/test_docstrings.py b/tests/test_docstrings.py index 11560df..85c8b59 100644 --- a/tests/test_docstrings.py +++ b/tests/test_docstrings.py @@ -34,7 +34,10 @@ def test_add_attrs_doc(): assert SomeClass.__gt__.__doc__ == doc assert SomeClass.__lt__.__doc__ == doc assert SomeClass.__le__.__doc__ == doc - assert SomeClass.__ne__.__doc__ == "\n Check equality and either forward a NotImplemented or return the result\n negated.\n " + assert SomeClass.__ne__.__doc__ in { + "Return ``self != other``.", + "\n Check equality and either forward a NotImplemented or return the result\n negated.\n ", + } assert SomeClass.__repr__.__doc__ == doc else: diff --git a/tests/test_output/doc-test/test-root/conf.py b/tests/test_output/doc-test/test-root/conf.py index e195e68..34fdd62 100644 --- a/tests/test_output/doc-test/test-root/conf.py +++ b/tests/test_output/doc-test/test-root/conf.py @@ -7,7 +7,3 @@ github_username = "domdfcoding" github_repository = "sphinx-toolbox" source_link_target = "GitHub" - -autodoc_default_options = { - "exclude-members": "__repr__", - } diff --git a/tests/test_output/doc-test/test-root/docstrings.rst b/tests/test_output/doc-test/test-root/docstrings.rst index 5cb4a37..58c7d90 100644 --- a/tests/test_output/doc-test/test-root/docstrings.rst +++ b/tests/test_output/doc-test/test-root/docstrings.rst @@ -6,8 +6,10 @@ The Sphinx output looks like: .. automodule:: attr_utils.annotations :members: AttrsClass + :exclude-members: __init__ :special-members: .. autoattrs:: attr_utils.annotations.AttrsClass :members: + :exclude-members: __init__ :special-members: diff --git a/tests/test_output/test_output/test_html_output_annotations_html_.html b/tests/test_output/test_output/test_html_output_annotations_html_.html index f12b948..0f6e4c2 100644 --- a/tests/test_output/test_output/test_html_output_annotations_html_.html +++ b/tests/test_output/test_output/test_html_output_annotations_html_.html @@ -196,4 +196,4 @@

- \ No newline at end of file + diff --git a/tests/test_output/test_output/test_html_output_docstrings_html_.html b/tests/test_output/test_output/test_html_output_docstrings_html_.html index 3470fca..047e432 100644 --- a/tests/test_output/test_output/test_html_output_docstrings_html_.html +++ b/tests/test_output/test_output/test_html_output_docstrings_html_.html @@ -570,44 +570,6 @@

-
-
- - __init__ - - - ( - - - - name - - - , - - - age - - - , - - - occupations - - - - ) - - - ¶ - -
-
-

- Method generated by attrs for class AttrsClass. -

-
-
@@ -764,6 +726,49 @@

+
+
+ + __repr__ + + + ( + + + ) + + + ¶ + +
+
+

+ Return a string representation of the + + + + AttrsClass + + + + . +

+
+
+ Return type +
+
+

+ + + str + + +

+
+
+
+
@@ -1050,26 +1055,14 @@

- __init__ + __le__ ( - name - - - , - - - age - - - , - - - occupations + other @@ -1081,14 +1074,40 @@

- Method generated by attrs for class AttrsClass. + Return + + + self + + + <= + + + other + + + .

+
+
+ Return type +
+
+

+ + + bool + + +

+
+
- __le__ + __lt__ ( @@ -1113,7 +1132,7 @@

self - <= + < other @@ -1140,7 +1159,7 @@

- __lt__ + __ne__ ( @@ -1165,7 +1184,7 @@

self - < + != other @@ -1192,16 +1211,11 @@

- __ne__ + __repr__ ( - - - other - - ) @@ -1211,18 +1225,14 @@

- Return - - - self - - - != - - - other - - + Return a string representation of the + + + + AttrsClass + + + .

@@ -1233,7 +1243,7 @@

- bool + str

@@ -1308,4 +1318,4 @@

- \ No newline at end of file +